Skip to content

Latest commit

 

History

History
480 lines (351 loc) · 32.3 KB

CHANGELOG.md

File metadata and controls

480 lines (351 loc) · 32.3 KB

Changelog

For a list of breaking changes, check here.

Unreleased

  • Fix #1537: stackoverflow with potemkin import vars with cyclic references

2022.01.13

  • Add linter :conflicting-fn-arity: warn when an arity occurs more than once in a function that overloads on arity. #1136 (@mknoszlig)
  • Add linter :clj-kondo-config which provides linting for .clj-kondo/config.edn. #1527
  • Relax :reduce-without-init for functions known to be safe #1519
  • Symbol arg to fdef can be arbitrary namespace #1532
  • Improve potemkin generated var-definition analysis #1521 (@ericdallo)
  • Stabilize cache version independent from kondo version #1520. This allows you to re-use the cache over multiple kondo versions.
  • :output {:progress true} should print to stderr #1523
  • Only print informative messages when --debug is enabled. #1514
  • Add Sublime Text instructions #827 (@KyleErhabor)
  • Fix end location in anonyous function body #1533
  • Bump datalog-parser to 0.1.9: allows symbol constants in datalog expression

2021.12.19

New

  • Add linter :reduce-without-init: warn against two argument version of reduce. Disabled by default. See docs. #1064 (@mknoszlig)
  • Add linter :quoted-case-test-constant: warn on quoted test constants in case. #1496 (@mknoszlig)

Enhanced

  • Fix false positive unused binding in re-frame subscribe #1504
  • Fix exclude-defmulti-args for CLJS #1503
  • Fix warning location of namespaced map #1475
  • False positive :docstring-no-summary on multiline docstrings #1507

2021.12.16

New

  • Automatically load configurations from .clj-kondo/*/*/config.edn. This can be disabled with :auto-load-configs false. #1492
  • Add linter :duplicate-case-test-constant: detect duplicate case test constants. See docs. #587 (@mknoszlig)
  • Add linter :unexpected-recur: warn on recur in unexpected (non-tail) position. #1126
  • Add linter :used-underscored-binding: warn on used bindings that start with underscore. Disabled by default. See docs. #1149 (@mknoszlig)
  • Add linter :docstring-blank for checking empty docstring. See docs. #805 (@joodie)
  • Add linter :docstring-leading-trailing-whitespace for checking leading and trailing whitespace in docstring. Disabled by default. See docs. #805 (@joodie)
  • Add linter :docstring-no-summary for checking the absence of summary of args in docstring. Disabled by default. See docs. #805 (@joodie)
  • Add :exclude-defmulti-args option for :unused-bindings linter. See docs. #1188 (@mknoszlig)
  • Support :config-in-comment #1473. See docs.

Enhanced

  • Bump built-in cache for clojure 1.11.0-alpha3 and clojure.data.json
  • Reword :refer suggestion so you can copy paste it #1293 (@vemv)
  • Add re-frame analysis output #1465 (@benedekfazekas)
  • Qualified map causes too many arguments in type checker #1474
  • Handle reader conditional with unknown language #970

2021.12.01

  • Improve linting in extend-protocol, extend-type, reify, specify! #1333, #1447
  • Support :context in nodes in hooks for adding context to analysis #1211
  • goog.object, goog.string etc must be required before use in newer releases of CLJS #1422
  • Resume linting after invalid keyword #1451
  • Fix install script for relative dir opts #1444
  • Fix type mismatch error with auto-qualified keyword #1467
  • String type hint causes false error report #1455
  • Fix false positive with cljs/specify! #1450
  • Improve analysis for ns-modifying destructuring key #1441
  • CLJS (exists? foo.bar/az) complains about require #1472

2021.10.19

New

  • New optional linter: warn on missing gen-class if namespace has -main fn #1417. See docs.
  • Detect arity mismatches for functions defined with def #1408
  • Type inference improvements for def + fn combination #1410
  • Local fn type inference #1412
  • Analysis: allow user to request all or specific metadata be returned #1280 (@lread)
  • rseq called on other type than vector or sorted-map now gives type error #1432

Enhanced / fixed

  • Fix false positive with ns-unmap #1393
  • Support custom-lint-fn with .cljc #1403
  • Allow reader conditional in metadata #1414
  • Analysis: add :from-var in higher order call #1404
  • Dedupe linted files #1395 (@ericdallo)
  • Add :duplicate-ns to duplicate-require linter output #1421 (@ericdallo)
  • if-let / if-some with invalid arity no longer warn #1426
  • Analysis: spport for defn 2nd attr-map, :doc derivation fixes (@lread)
  • Fix parsing of trailing metdata map #1433 (@lread)

2021.09.25

  • Update built-in cache to clojure 1.11.0-alpha2 #1382
  • Take into account aliases in import-vars #1385
  • Consider var as used in CLJS case to avoid false positives for constants #1388
  • Understand ns-unmap pattern #1384
  • Expose config functions in core API namespace #1389
  • Fix false positives when using quoted collection in function position #1390

Analysis

  • Add :end-row, :end-col to :var-usages analysis element #1387
  • BREAKING: Change :row and :col for :var-usages to use the start location of the call instead of the name location #1387

2021.09.15

  • Support :as-alias (new feature in Clojure 1.11) #1378
  • Improve :loop-without-recuir wrt/ fn and other constructs that introduce a recur target #1376

2021.09.14

  • Add :loop-without-recur linter. #426
  • Lint deps.edn and bb.edn :paths #1353 (@lread)
  • Fix unresolved-symbol for all-lowercase class name #1362
  • Add :refer to var-usages when inside a require #1364 (@ericdallo)
  • musl fix #1365 (@thiagokokada)
  • Fix incorrectly reported filename #1366
  • Self-referring private-var should be reported unused if not used elsewhere #1367
  • Support options map in babashka.process/$ #1368
  • Analyze metadata map of defmulti #1310
  • Add support for potemkin full qualified symbols #1371 (@ericdallo)

2021.08.06

  • Expose ns-analysis fn in hooks API #1349 (@hugoduncan)
  • Fix for Windows when analyzing deps

2021.08.03

Enhanced / fixed

  • Fix conflicts between application code and hook config code in cache #1340
  • Allow overriding level in reg-finding! #1344 (@ericdallo)
  • Fix declare name positions in analysis #1343 (@ericdallo)
  • Updated rules for deps.edn to match Clojure CLI 1.10.1.933 (@dpassen)

2021.07.28

New

  • :macroexpand hook. This allows linting using the same or similar macros from your code. See docs.

Enhanced / fixed

  • Add types for ex-info #1314
  • Bump SCI to v0.2.6
  • Fix EDN/JSON serialization of findings for NPM string namespace #1319
  • Support fully qualified symbol in def referring to current namespace #1326
  • Fix false positive redundant expression in pre-post map #1335

2021.06.18

New

  • Lint arities of fn arguments to higher order functions (map, filter, reduce, etc.) #1297
  • Add map-node and map-node? to hooks API #1270

Enhanced / fixed

  • Disable redefined-var warning in comment #1294
  • :skip-comments false doesn't override :skip-comments true in namespace config #1295
  • False positive duplicate element set for symbols/classes #1296

v2021.06.01

  • False positive unused namespace with clojure.spec/keys #1289

v2021.05.31

New

  • Lint clojure.spec.alpha/keys #1272 (@daveduthie)
  • Macroexpand clojure.template/do-template #603
  • Proper macroexpansion for clojure.test/are #1284
  • Resolve vars in clojure.data.xml imported via macro #1274
  • Lint ([]) as invalid call to vector #1276

Enhanced / fixed

  • Improve keyword reg support for re-frame #1159 (@ericdallo)
  • Refine messaging around importing configs #1256 (@lread)
  • Static linux binary is now compiled with musl
  • Recognize :doc from attr-map in defn #1265
  • Don't skip linting .jar files with --dependencies when config(s) have changed #1285

2021.04.23

New

  • --fail-level flag to specify the minimum severity for a non-zero exit code #1259 (@RickMoynihan)

Enhanced / fixed

  • Support core.async defblockingop macro #1244
  • Add error message when keywords are passed in :or map #1242
  • False positive unused default when analyzing locals #1246
  • False positive when destructuring depends on previous arg #782
  • Keyword analysis for namespaced maps #1251 (@ericdallo)
  • Report reader errors at the start of token #1255 (@yuhan0)
  • Fix recur arity for lazy-seq and lazy-cat (@yuhan0)
  • Prioritize aliases over object access in CLJS #1248 (@jahson)

2021.03.31

Enhanced / fixed

  • :defined-by contains raw node for sgen fns #1231
  • Fix wrong order of unresolved symbols #1237
  • Remove generated nodes from analysis #1239 (@ericdallo)
  • Add :report-duplicates linter config for several linters. #1232 (@snoe)

2021.03.22

New

  • --copy-configs flag to indicate copy configs from dependencies while linting. This replaces --no-warnings.
  • --dependencies flag to indicate skipping already linted jars for performance. This replaces --no-warnings.

Enhanced / fixed

  • Support js property access syntax #1189
  • Fix linting user.clj #1190
  • Add linting for sgen/lazy-prims #1192
  • NullPointerException when ignoring :deprecated-var #1195
  • Fix :lint-as with cond-> #1205
  • Expose config to hook fns #1208 (@not-in-stock)
  • Fix crash with :clj-kondo/ignore in combination with :rename #1210
  • Fix false positive unresolved symbol in CLJS type hint #1212
  • Fix invalid namespace in clojure.data.xml analysis #1202
  • Fix analysis of clojure.core.reducers/defcurried #1217
  • Add :defined-by on missing var definitions #1219 (@ericdallo)
  • Add name positions to local-usage analysis #1220 (@ericdallo)
  • False positive :unused-private-var warning for deftype ^:private #1222
  • Correct escaping for docstrings in analysis #1224 (@lread)

2021.03.03

Enhanced / fixed

  • Redundant expression false positive #1183
  • Redundant expression false positive #1185
  • Regression in unresolved symbol config #1187

2021.02.28

New

  • Lint nested function literal #636
  • Redundant expression linter #298
  • Add :exclude config to :refer linter #1172
  • Warn on non-existent var in :refer #546
  • Support clojure.data.xml/alias-uri#1180

Enhanced / fixed

  • Fix schema.core/defmethod linting for vectors dispatch-values #1175 (@leoiacovini)
  • Continue analyzing on invalid symbol #1146
  • Standalone require should be emitted to analysis #1177
  • Upgrade sci to 0.2.4

2021.02.13

Thanks to @snoe and @ericdallo for contributing to this release. Thanks to the sponsors on Github, OpenCollective and Clojurists Together for making this release possible.

New

Enhanced / fixed

  • BREAKING: Don't use lint-as for hooks #1170
  • Fix crash when linting kitchen-async #1148
  • Memory optimizations for clojure-lsp commit
  • Upgrade to GraalVM 21.0.0 #1163
  • Fix analysis of case dispatch vals #1169
  • Potemkin improvement with regards to unresolved var #1167
  • Exported config fix for git deps #1171
  • Add :aliases to ns ctx and :alias to var-usages #1133 (@snoe)
  • Add :end-row and :end-col to var-definitions bucket on analysis #1147 (@ericdallo)
  • Fix unresolved var clojure.spec.gen.alpha/fmap #1157

2021.01.20

Thanks to @SevereOverfl0w, @jysandy, @tomdl89, @snoe, @audriu, and @ericdallo for contributing to this release.

New

  • New linter: :unresolved-var. This detects unresolved vars in other namespaces, like set/onion. See docs. #635
  • Alpine Docker build #1111
  • Add locals to analysis #1109 (@snoe)
  • Add analysis for arglists #1123 (@snoe)

Enhanced / fixed

  • Fix finding without location info #1101
  • Detect duplicate key in '{[1 2] 3, (1 2) 4} #1056 (@jysandy)
  • Add cljs.core cases in lint-specific-calls! #1116 (@tomdl89)
  • [#1099] Add :single-operand-logical linter for and and or #1122 (@tomdl89)
  • Add :ns to :unused-namespace findings (@ericdallo)
  • Derive config dir from only file path linted #1135
  • Support name in defmethod fn-tail #1115
  • Avoid crash when using :refer-clojure + :only #957

v2020.12.12

New

  • Documentation: a list of all available linters #936
  • Lint protocol and interface implementations in deftype and defrecord #140
  • Upgrade to GraalVM 20.3.0 #1085
  • Support cljs.core/simple-benchmark syntax #1079
  • Support babashka.process/$ macro syntax #1089

Enhanced / fixed

  • Fix recur arity in doysync #1081
  • Alias linter doesn't recognize (quote alias) form #1074
  • Fix retries for refer :all when linting in parallel #1068
  • Improve analyzing syntax of amap #1069
  • Namespaced map in deps.edn causes false positive #1093
  • Support ignore hints in deps.edn #1094
  • Fix unsorted namespaces linter for nested libspecs #1097
  • Fix reported ns name in analysis for nested libspecs #1100

v2020.11.07

Thanks @bennyandresen, @jaihindhreddy, @mharju, @pepijn, @slipset and @nvuillam for contributing to this release. Thanks to Clojurists Together for sponsoring this release.

New

  • Lint deps.edn #945
  • --filename option to set filename when linting from stdin. This should be used for editor plugins to enable deps.edn linting.
  • Export and import config via classpath #559, clj-kondo/config#1
  • --no-warnings flag to indicate linting is used to populate cache.
  • Skip already linted jars #705
  • Implement :include option for shadowed-var linter #1040
  • Return :files count in summary #1046

Enhanced

  • Better resolving of vars referred with :all #1010
  • Fix false positive with format #1044
  • Fix index out of bounds exception clj-kondo.lsp#11
  • More robust marking of generated nodes to avoid redundant dos and lets despite location metadata #1059

v2020.10.10

Thanks @zilti, @dharrigan and @sogaiu for contributing to this release. Thanks to Clojurists Together for sponsoring this release.

New

Fixed / enhanced

  • Fix memory leak in long running process #1036
  • Claypoole config enhancements clj-kondo/config#7
  • Don't warn about redundant let and do in hook-generated code #1038
  • Fix format string false positive #1007
  • Parse failure in (or) #1023
  • Analyze require in top-level do #1018
  • Analyze quote in require #1019
  • Base Docker image on Ubuntu latest #1026

v2020.09.09

Thanks to @cldwalker, @bfontaine, @snoe, @andreyorst, @jeroenvandijk, @jaihindhreddy, @sittim and @sogaiu for contributing to this release. Thanks to the people who helped designing the new features in Github issue conversations. Thanks to Clojurists Together for sponsoring this release.

New

  • Add --parallel option to lint sources in parallel. This will speed up linting an entire classpath. #632, #972

  • Detect error when calling a local that's not a function. #948

    (let [inc "foo"]
      (inc 1))
      ^--- String cannot be called as a function
  • Support ignore hints #872:

    (inc 1 2 3)
    ^--- clojure.core/inc is called with 3 args but expects 1
    
    #_:clj-kondo/ignore
    (inc 1 2 3)
    ^--- arity warning ignored
    
    #_{:clj-kondo/ignore[:invalid-arity]}
    (do (inc 1 2 3))
    ^--- only redundant do is reported, but invalid arity is ignored

    Also see config.md.

  • Merge config from $HOME/.config/clj-kondo, respecting XDG_CONFIG_HOME. See config.md for details. #992

  • New :config-paths option in <project>/.clj-kondo/config.edn. This allows extra configuration directories to be merged in. See config.md for details. #992

  • Config tool that can spit out library specific configurations that can be added via :config-paths. Contributions for libraries are welcome.

  • Experimental spec inspection tool that attempts to extract type information for linting. Also uses the new :config-paths feature.

  • Allow pinned version in installation script #946 (@cldwalker)

Fixed

  • Fix docstring in Rum defc hook #960
  • Format string checking improvements #942, #949
  • False positive with into and transducer #952
  • Alias usage not detected in keywords when in quoted form #981
  • Fully qualified class name incorrectly assumed to be var #950
  • Backup existing clj-kondo binary when installing #963 (@bfontaine)
  • Various documentation fixes and improvements (@jeroenvandijk, @sittim, @sogaiu)

Misc

Prior to v2020.09.09

Details about releases prior to v2020.09.09 can be found here.

Breaking changes

2021.09.25

  • Change :row and :col for :var-usages to use the start location of the call instead of the name location #1387

2020.10.10

  • Base Docker image on Ubuntu latest instead of Alpine #1026
  • Don't use lint-as for hooks #1170