chore: add lsp clean-ns in lint-fix (#17661)

This commit is contained in:
yqrashawn 2023-10-18 00:17:43 +08:00 committed by GitHub
parent 6f9bcd1bb1
commit 4c2ae2338a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 3 deletions

1
.lsp/config.edn Normal file
View File

@ -0,0 +1 @@
{:clean {:ns-inner-blocks-indentation :keep}}

View File

@ -324,6 +324,7 @@ lint-fix: ##@test Run code style checks and fix issues
ALL_CLOJURE_FILES=$(call find_all_clojure_files) && \ ALL_CLOJURE_FILES=$(call find_all_clojure_files) && \
zprint '{:search-config? true}' -sw $$ALL_CLOJURE_FILES && \ zprint '{:search-config? true}' -sw $$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 && \ sh scripts/lint-trailing-newline.sh --fix && \
yarn prettier yarn prettier

View File

@ -22,8 +22,6 @@ in mkShell {
lsof # used in start-react-native.sh lsof # used in start-react-native.sh
# build specific utilities # build specific utilities
clojure maven watchman clojure maven watchman
# lint specific utilities
clj-kondo zprint
# other nice to have stuff # other nice to have stuff
yarn nodejs python310 yarn nodejs python310
] # and some special cases ] # and some special cases

View File

@ -18,7 +18,11 @@ let
# for calling clojure targets in CI or Makefile # for calling clojure targets in CI or Makefile
clojure = mkShell { 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. # CLASSPATH from clojure deps with 'src' appended to find local sources.
shellHook = with pkgs; '' shellHook = with pkgs; ''
export CLASS_PATH="$(find ${deps.clojure} -iname '*.jar' | tr '\n' ':')src" export CLASS_PATH="$(find ${deps.clojure} -iname '*.jar' | tr '\n' ':')src"