0.21.1: Custom linting via clj-kondo
The big feature of this release is a custom clj-kondo
config for sicmutils. All macros in the library (let-coordinates
, with-coordinate-functions
, all of the pattern matching macros and more) now show proper linter warnings; the pattern matching macros in particular will now show helpful warnings on cases where you've made an easy-to-correct mistake in your pattern syntax.
For example, the following form:
(require '[sicmutils.rule :as r])
(r/rule (+ (? x) (? y)) => (+ (? y odd?) (? x)))
Will provide this inline linter warning, appearing as you type:
Restrictions are not allowed in consequence bindings: odd?
See here for the full list of macros handled by the config.
- The exported clj-kondo config lives here
- To install the config into your project, see the Linter instructions here
Linting
-
#477 adds tight integration with the
clj-kondo
linter via an exported clj-kondo configuration in theresources
directory. All macros in the library now offer pleasant linting to users. This is especially helpful for the macros inpattern.rule
, which now can offer live feedback to pattern-matching authors.See
doc/linting.md
for details on various warnings reported, and installation instructions for the clj-kondo config.Thanks to @borkdude for all of his help getting this working, and making this amazing project!
-
All linter errors and warnings are now addressed, fixed and silenced for the entire codebase, both
test
andsrc
directories. -
A new Github Action will run the linter for every PR and push to master, and annotate PRs with linter warnings and errors.
-
Additions
-
#481 adds a new
x-degree
argument tosicmutils.polynomial/univariate->dense
, for padding the result with zeros in the case that you want to guarantee a certain dense degree in the result. -
#477:
-
com.gfredericks/test.chuck
dev dependency upgraded to0.2.13
to grab its clj-kondo exported config. -
pattern.rule
patterns can now handle spliced and unquote-spliced inputs in their symbol position.
-
Bug Fixes
-
#481 fixes a long-standing (test-only) bug in
sicmutils.polynomial-test
around palindromic polynomials -
#480:
sicmutils.numerical.quadrature/definite-integral
now coerces the result of non-compiled integrands in cljs to double. This prevents the @kloimhardt bug where certain paths would produceBigInt
instances and fail in quadrature calls. -
in #477, I found the following bugs with the help of the linter:
-
Deleted the unused
sicmutils.differential/d:apply
. -
Fixed a bug with
sicmutils.expression.render/->JavaScript
not using the second argument toremainder
. -
deleted
sicmutils.numerical.quadrature.common
in favor ofsicmutils.generic/infinite?
-
Fixed a broken integrator in
sicmutils.numerical.quadrature.simpson38
, and fixed the tests to actually stress this code. -
Fixed a bug where
sicmutils.numerical.quadrature.substitute/exponential-upper
was not actually using its input function! -
unused
simplify
argument removed fromsicmutils.simplify.rules/non-negative-factors!
and all uses. -
Bug fix in
sicmutils.special.elliptic/jacobi-elliptic-functions
; deep in the gnarly fn, one of the branches returned nil instead of its required values. Thank you, linter! -
sicmutils.pattern/template
will no longer error in the 1-arity case when some form contains a binding entry like(? (fn [m] ...))
. Instead, the function will be passed an empty map.
-