Skip to content

Releases: clj-kondo/clj-kondo

v2020.07.26

26 Jul 15:05
Compare
Choose a tag to compare

Thanks @seanpoulter, @lread, @rschmukler, @sittim for contributing to this release.

New

Lint format string argument count mismatches #938:

Screenshot 2020-07-26 17 08 41

Screenshot 2020-07-26 12 12 08

This linter is triggered with clojure.core/format and clojure.tools.loggins functions that use a format string.

Enhancements

  • Add :cljc (boolean), :lang (:cljs or :cljc) and :filename keys to hook API function #920
  • Upgrade GraalVM native-image build to java11-20.1.0.
  • Configure :unused-private-var via ns metadata #924
  • Support ns meta config for unused binding linter #932
  • Fix unexpected missing docstring warning with potemkin/import-vars #935

Hooks!

21 Jun 11:51
Compare
Choose a tag to compare

New

This release introduces a new hooks API which can be used to handle unrecognized macros.

Read the documentation here!
See an example hook for the Rum defc macro here.

The corresponding issue: #811

I encourage library authors to publish config and hooks for their libraries here.

This work was sponsored by Clojurists Together as part of their Summer of Bugs program.

Also see my blog article on hooks.

Enhancements

  • Fix false positive unused private var #915
  • Fix false positive private var usage #918

v2020.06.12

12 Jun 08:58
Compare
Choose a tag to compare

Thanks @laurio and @rap1ds for contributing to this release.

New

  • Add redundant do check for when-first and when-some #887 (@laurio)
  • Allow explicitly setting config-dir #906
  • Support namespace local config for unused import #909

Enhancements / fixes

  • clj-kondo/print! pod function does not print
  • Bump up datalog-parser to 0.1.3 (and eventually to 0.1.7) #890 (@rap1ds)
  • Fix for str/replace type check #889
  • Fix type checking in the presence of metadata #903
  • Fix redundant let by looking at namespace of let call #901
  • Fix unused binding warning in doto expansion with no children #908
  • Fix unused import in defprotocol type hint #911
  • Map ^Integer to :nilable/int type

v2020.05.09

09 May 19:06
Compare
Choose a tag to compare

Thanks @lread for contributing to this release.

New:

  • #883: add analyzer for clojure.core/amap
  • #886: add babashka pod support. See docs.

Fixes:

  • #858: fix fulcro unused namespace warning
  • #878: fix false positive unused binding with proxy-super
  • #880: fix false positive map key warning
  • #884: fix warning with str/replace
  • #885: unsorted namespace linter: alphabetically, strings go before symbols

v2020.05.02

02 May 10:32
Compare
Choose a tag to compare

Thanks to @PEZ, @OscarMarshall, @rymndhng, @jr0cket, @Heliosmaster, @martinklepsch, @DeLaGuardo and @abogoyavlensky for contributing to this release.

The following issues were resolved:

  • #245: report unused defaults when binding itself is unused:
    Screenshot 2020-04-08 11 15 22

  • #558: warn on when with empty body

  • #773: warn about missing catch or finally in try:

    Screenshot 2020-04-26 18 16 58
  • #800: suppress missing docstring for defprotocol

  • #824, #862: accept multiple --lint and --config options

  • #835: document pre-commit hook

  • #841: update VSCode / Calva documentation

  • #845: :single-key-in linter throws in expressions without arguments

  • #847: New optional :refer linter. Emit warning for all usages of :require + :refer

    Screenshot 2020-04-15 20 23 42
  • #850: consider this to be used when calling proxy-super

  • #859: warn on unresolved namespace in keywords like ::foo

  • #852: link to Spacemacs + LSP documentation

  • #860: accept goog.DEBUG symbol in CLJS

  • #864: prefer alias over full namespace name

  • #867: accept ^number tag in CLJS

  • #870: :unresolved-namespace linter can be configured in namespace metadata config

  • #875: :unresolved-namespace linter is configurable

v2020.04.05

05 Apr 11:49
Compare
Choose a tag to compare

Thanks @JDurstberger, @seancorfield and @Heliosmaster for contributing to this release.

New:

  • #679: warn about conflicting aliases

    Screenshot 2020-04-05 13 57 42
  • #791: add warnings for missing else branches in if-let, if-some and if-not. This linter was renamed from :if to :missing-else-branch while remaining backwards compatible (see #830).

    Screenshot 2020-04-05 13 58 46
  • #815: warn on get-in, assoc-in etc. with single key. This new linter is called :single-key-in and is disabled by default.

    Screenshot 2020-04-05 14 00 55
  • #821: add analyzers for common JDBC wrappers.

Enhancements:

  • #748: install script - add option for download dir
  • #816 don't warn about goog.global in CLJS as unresolved symbol
  • #819: fix false positive warning when using the result of byte as a number in +
  • #833: when linting as clojure.test/deftest, don't warn about missing docstrings

clj-kondo's 1st birthday release!

20 Mar 10:26
Compare
Choose a tag to compare

Thanks @timothypratley for contributing to this release.

  • Add API function to merge clj-kondo configurations: clj-kondo.core/merge-configs
    This makes it easier to programmatically create configurations which can be spit out to .clj-kondo/config.edn.

  • Upgrade to Clojure 1.10.2-alpha1

  • Add list of companies using clj-kondo

  • #780: emit type error for (str/replace "foo" "o" (fn [_]))

  • #784: fix type warning with clojure.core/byte

  • #787, #795: fix type warnings with clojure.string/replace

  • #789, #802: IntelliJ documentation improvements.

  • #796: fix false positive unused import when used in threading macro

  • #800: fix false positive missing docstring warnings

  • #810: improvement of linting syntax for :import and fix for NPE when linting (:import [foo :refer [bar]])

    Screenshot 2020-03-20 11 08 07

v2020.02.28

28 Feb 15:11
Compare
Choose a tag to compare

Thanks @laurio, @lispyclouds and @timothypratley for contributing to this release.

Fixed issues

  • #513: add custom type checks for combinations of args in clojure.string/replace
  • #703: make static linux build available
  • #755: add redundant do check for `future
  • #756: fix false negative type error with assoc
  • #758: add redundant do check for with-let
  • #760: fix false positive warning of unsorted clojure.test clause in CLJS
  • #761: warn on incorrect syntax for import
  • #763: accept unquoted configs in ns metadata
  • #767: add type information for tree-seq
  • #770: improve Docker image size
  • #774: improve Cursive installation screenshot
  • #776: let type inference for function return types

Screenshot 2020-02-28 15 33 04

  • Add type information for clojure.core/format

v2020.02.15

15 Feb 10:23
Compare
Choose a tag to compare

Thanks to @Heliosmaster, @ethpran, @Sudakatux, @vemv and @abogoyavlensky for contributing to this release.

New

  • #260: warn about single operand comparisons which are always true or false

    Screenshot 2020-02-11 10 49 33
  • #708: :unsorted-required-namespaces linter:

    Screenshot 2020-01-28 15 37 44

    This linter is disabled by default and can be enabled by setting the level to :warning or :error in .clj-kondo/config.edn:

    {:linters {:unsorted-required-namespaces {:level :warning}}}

    Note: this linter ignores clauses wrapped in reader conditionals, since there is no clearly defined sort order for those.

  • #726: emit type warning for (set/union (keys {}))

  • #728: return type inference:

    Screenshot 2020-02-01 15 01 11

    For those interested, this file lists return types that have been inferred for namespaces with built-in support (clojure.core, clojure.zip, etc).
    E.g. we have been able to infer the return type of zip/insert-child as :vector since it returns the result of zip/replace which has the return type :vector.

  • #733, #743: infer return types from if, if-let, when, when-let, cond, and and or

    Screenshot 2020-02-13 21 44 30

Fixed

  • #430: level not supported in inline configs

  • #719: passing file with --config throws exception

  • #742: limit scope of if-let binding to first expression

v2020.01.27

27 Jan 10:21
Compare
Choose a tag to compare

Solved issues

  • #462: catch more cases of missing test assertions

Screenshot 2020-01-26 19 15 26

  • #702: support absolute paths in libspecs. This is a feature used by shadow-cljs.

  • #706: fix false positive unused imported class when used as type hint in macro

  • #710: report redundant do expressions in when and when-not

  • #711: expose :end-row and :end-col in :findings for usage with LSP server. See https://github.com/snoe/clojure-lsp/issues/66.

  • #713: unused private var: highlight name instead of start of expression