Releases: clj-kondo/clj-kondo
v2020.07.26
Thanks @seanpoulter, @lread, @rschmukler, @sittim for contributing to this release.
New
Lint format string argument count mismatches #938:
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 tojava11-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!
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
v2020.06.12
Thanks @laurio and @rap1ds for contributing to this release.
New
- Add redundant do check for
when-first
andwhen-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
v2020.05.02
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:
-
#558: warn on
when
with empty body -
#773: warn about missing
catch
orfinally
in try: -
#800: suppress missing docstring for defprotocol
-
#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
-
#850: consider
this
to be used when callingproxy-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
Thanks @JDurstberger, @seancorfield and @Heliosmaster for contributing to this release.
New:
-
#679: warn about conflicting aliases
-
#791: add warnings for missing else branches in
if-let
,if-some
andif-not
. This linter was renamed from:if
to:missing-else-branch
while remaining backwards compatible (see #830). -
#815: warn on
get-in
,assoc-in
etc. with single key. This new linter is called:single-key-in
and is disabled by default. -
#821: add analyzers for common JDBC wrappers.
Enhancements:
clj-kondo's 1st birthday release!
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
-
#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]])
v2020.02.28
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 forwith-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
- Add type information for
clojure.core/format
v2020.02.15
Thanks to @Heliosmaster, @ethpran, @Sudakatux, @vemv and @abogoyavlensky for contributing to this release.
New
-
#260: warn about single operand comparisons which are always
true
orfalse
-
#708:
:unsorted-required-namespaces
linter: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:
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 ofzip/insert-child
as:vector
since it returns the result ofzip/replace
which has the return type:vector
. -
#733, #743: infer return types from
if
,if-let
,when
,when-let
,cond
,and
andor
Fixed
v2020.01.27
Solved issues
- #462: catch more cases of missing test assertions
-
#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
andwhen-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