File tree Expand file tree Collapse file tree 5 files changed +25
-12
lines changed Expand file tree Collapse file tree 5 files changed +25
-12
lines changed Original file line number Diff line number Diff line change 14
14
:leave (let [{:keys [name]} (current-task )] (status/line :detail " \n TASK %s done." name))
15
15
; ; commands
16
16
apply-import-vars {:task apply-import-vars/-main :doc " (check|gen-code) - export APIs statically from templates" }
17
- lint {:task lint/-main :doc " [--rebuild-cache ] lint source code using clj-kondo, eastwood, whitespace-linter" }
18
- -lint-kondo {:task lint-kondo/-main :doc " [--rebuild-cache ]" }
17
+ lint {:task lint/-main :doc " [--rebuild] lint source code using clj-kondo, eastwood, whitespace-linter" }
18
+ -lint-kondo {:task lint-kondo/-main :doc " [--rebuild]" }
19
19
-lint-eastwood {:task lint-eastwood/-main}
20
20
-lint-whitespace {:task lint-whitespace/-main}
21
21
test-clj {:task test-clj/-main :doc " [--clojure-version (1.8|1.9|1.10|1.11)]" }
Original file line number Diff line number Diff line change 21
21
; ;
22
22
:lint-cache {:replace-paths [" src" ]} ; ; when building classpath we want to exclude resources
23
23
; ; so we do not pick up our own clj-kondo config exports
24
- :clj-kondo {:extra-deps {clj-kondo/clj-kondo {:mvn/version " 2022.04.25 " }}
24
+ :clj-kondo {:extra-deps {clj-kondo/clj-kondo {:mvn/version " 2022.05.27 " }}
25
25
:override-deps {org.clojure/clojure {:mvn/version " 1.11.1" }}
26
26
:main-opts [" -m" " clj-kondo.main" ]}
27
27
Original file line number Diff line number Diff line change @@ -296,7 +296,7 @@ bb lint
296
296
and you can too. The lint script will build the clj-kondo cache when it is missing or stale.
297
297
If you want to force a rebuild of the cache run:
298
298
----
299
- bb lint --rebuild-cache
299
+ bb lint --rebuild
300
300
----
301
301
302
302
https://github.com/borkdude/clj-kondo/blob/master/doc/editor-integration.md[Integrate clj-kondo into your editor] to catch mistakes as they happen.
Original file line number Diff line number Diff line change 19
19
[nil cmd args])
20
20
opts (merge opts default-opts )]
21
21
(apply tasks/shell opts cmd args)))
22
+
23
+ (defn clojure
24
+ " Wrap tasks/clojure for my loud error reporting treatment"
25
+ [& args]
26
+ (let [[opts args] (if (map? (first args))
27
+ [(first args) (rest args)]
28
+ [nil args])
29
+ opts (merge opts default-opts )]
30
+ (apply tasks/clojure opts args)))
Original file line number Diff line number Diff line change 18
18
(fs/delete-tree clj-kondo-cache)))
19
19
20
20
(defn- build-cache []
21
- (status/line :detail " Building cache" )
22
21
(when (cache-exists? )
23
22
(delete-cache ))
24
- (let [clj-cp (-> (shell/command {:out :string }
25
- " clojure -A:test:lint-cache -Spath" )
26
- :out string/trim)
23
+ (let [clj-cp (-> (shell/clojure {:out :string }
24
+ " -Spath -M:test" )
25
+ with-out-str
26
+ string/trim)
27
27
bb-cp (bbcp/get-classpath )]
28
- (shell/command " clojure -M:clj-kondo --dependencies --copy-configs --lint" clj-cp bb-cp)))
28
+
29
+ (status/line :detail " - copying configs" )
30
+ (shell/command " clojure -M:clj-kondo --skip-lint --copy-configs --lint" clj-cp bb-cp)
31
+ (status/line :detail " - creating cache" )
32
+ (shell/command " clojure -M:clj-kondo --dependencies --parallel --lint" clj-cp bb-cp)))
29
33
30
34
(defn- check-cache [{:keys [rebuild-cache]}]
31
35
(status/line :head " clj-kondo: cache check" )
58
62
(def args-usage " Valid args: [options]
59
63
60
64
Options:
61
- --rebuild-cache Force rebuild of clj-kondo lint cache.
62
- --help Show this help." )
65
+ --rebuild Force rebuild of clj-kondo lint cache.
66
+ --help Show this help." )
63
67
64
68
(defn -main [& args]
65
69
(when-let [opts (main/doc-arg-opt args-usage args)]
66
- (lint {:rebuild-cache (get opts " --rebuild-cache " )})))
70
+ (lint {:rebuild-cache (get opts " --rebuild" )})))
67
71
68
72
(main/when-invoked-as-script
69
73
(apply -main *command-line-args*))
You can’t perform that action at this time.
0 commit comments