From 4c2ae2338a245c6d5869030f95168a2efcbdb3a2 Mon Sep 17 00:00:00 2001 From: yqrashawn Date: Wed, 18 Oct 2023 00:17:43 +0800 Subject: [PATCH] chore: add lsp clean-ns in lint-fix (#17661) --- .lsp/config.edn | 1 + Makefile | 1 + nix/shell.nix | 2 -- nix/shells.nix | 6 +++++- 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .lsp/config.edn diff --git a/.lsp/config.edn b/.lsp/config.edn new file mode 100644 index 0000000000..232387f7bf --- /dev/null +++ b/.lsp/config.edn @@ -0,0 +1 @@ +{:clean {:ns-inner-blocks-indentation :keep}} diff --git a/Makefile b/Makefile index b457eb67d3..900baf06cc 100644 --- a/Makefile +++ b/Makefile @@ -324,6 +324,7 @@ lint-fix: ##@test Run code style checks and fix issues ALL_CLOJURE_FILES=$(call find_all_clojure_files) && \ zprint '{:search-config? true}' -sw $$ALL_CLOJURE_FILES && \ zprint '{:search-config? true}' -sw $$ALL_CLOJURE_FILES && \ + clojure-lsp --ns-exclude-regex ".*/src/status_im2/core\.cljs$$" clean-ns && \ sh scripts/lint-trailing-newline.sh --fix && \ yarn prettier diff --git a/nix/shell.nix b/nix/shell.nix index b06cc48f7c..77147310a3 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -22,8 +22,6 @@ in mkShell { lsof # used in start-react-native.sh # build specific utilities clojure maven watchman - # lint specific utilities - clj-kondo zprint # other nice to have stuff yarn nodejs python310 ] # and some special cases diff --git a/nix/shells.nix b/nix/shells.nix index 97fa148119..a30ec7d013 100644 --- a/nix/shells.nix +++ b/nix/shells.nix @@ -18,7 +18,11 @@ let # for calling clojure targets in CI or Makefile clojure = mkShell { - buildInputs = with pkgs; [ clojure flock maven openjdk ]; + buildInputs = with pkgs; [ + clojure flock maven openjdk + # lint specific utilities + clj-kondo zprint clojure-lsp + ]; # CLASSPATH from clojure deps with 'src' appended to find local sources. shellHook = with pkgs; '' export CLASS_PATH="$(find ${deps.clojure} -iname '*.jar' | tr '\n' ':')src"