diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..10bd3e0 --- /dev/null +++ b/.clang-format @@ -0,0 +1,28 @@ +BasedOnStyle: LLVM + +IndentWidth: 4 +ColumnLimit: 120 + +IndentAccessModifiers: false +AccessModifierOffset: -4 + +AlignAfterOpenBracket: BlockIndent +BinPackParameters: false +BinPackArguments: false + +AllowAllParametersOfDeclarationOnNextLine: false +PenaltyBreakBeforeFirstCallParameter: 1 + +PointerAlignment: Left +ReferenceAlignment: Left + +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false + +BreakAfterReturnType: None +PenaltyReturnTypeOnItsOwnLine: 1000 + +BreakTemplateDeclarations: Yes + +NamespaceIndentation: All diff --git a/justfile b/justfile index 8b1867c..dabae76 100644 --- a/justfile +++ b/justfile @@ -28,8 +28,12 @@ clean *args: fi } - if pgrep -x logos > /dev/null; then - confirm "Kill 'logos' process?" && pkill logos + logos_procs="$(pgrep -ax logos_host_qt || true)" + if [ -n "$logos_procs" ]; then + echo "Found matching processes:" + echo "$logos_procs" + echo "This will kill the process(es) above." + confirm "Proceed?" && { pkill -x logos_host_qt; echo "Killed."; } else echo "Already killed" fi @@ -50,3 +54,19 @@ clean *args: run: (clean "-y") nix run + +# Launch CLion inside the Nix dev shell so it inherits required variables and fully integrates with Nix. +clion: + nix develop -c "$HOME/.local/share/JetBrains/Toolbox/apps/clion/bin/clion.sh" . >/dev/null 2>&1 & + +prettify: + nix shell nixpkgs#clang-tools -c clang-format -i src/**.cpp src/**.h + +# Reuses cmake-build-debug's compile_commands.json (generated by CLion) instead +# of a `configure` step — this repo has no standalone `build` recipe. +lint: + nix shell nixpkgs#clang-tools --command clang-tidy \ + -p cmake-build-debug \ + --header-filter='src/.*' \ + --extra-arg-before=--driver-mode=g++ \ + src/BlockchainPlugin.cpp src/BlockchainBackend.cpp src/AccountsModel.cpp src/LogModel.cpp