Releases: NoahTheDuke/splint
Releases · NoahTheDuke/splint
v1.2.0
Added
markdownoutput: Same text asfullbut with a fancy horizontal bar, header, and code blocks.:chosen-styleallows for rules to have configuration and different "styles". The first supported islint/not-empty?showing eitherseqornot-empty.
Changed
ctxis no longer an atom, but a plain map. The:diagnosticsentry is now the atom.splint.runner/check-formreturns the entire updatedctxobject instead of just the diagnostics. (I'm not entirely sure that's reasonable, but it's easily changed.)- Move a lot of rules from
linttostylegenre:apply-strapply-str-interposeapply-str-reverseassoc-assocconj-vectoreq-falseeq-nileq-trueeq-zerofilter-complementfilter-vec-filtervfirst-firstfirst-nextlet-domapcat-apply-applymapcat-concat-mapminus-oneminus-zeromultiply-by-onemultiply-by-zeroneg-checksnested-additionnested-multiplynext-firstnext-nextnot-eqnot-nilnot-some-predplus-oneplus-zeropos-checkstostringupdate-in-assocuseless-dowhen-dowhen-not-callwhen-not-dowhen-not-emptywhen-not-not
Breaking
- Add
ctxas first argument to:on-matchfunctions to pass in config to rules. Update functions insplint.runneras necessary.
v1.1.1
Changed
- Update Rule Documentation.
- Include new documentation in cljdoc.edn
v1.1.0
Added
- Write documentation for rules and patterns.
- Write docstrings for a bunch of
noahtheduke.spat.patternfunctions. - Include outside links in config in rules docs.
- Check
:spat/litmetadata to treat special symbols in pattern DSL as their literal values.
Changed
- Attempt to resolve predicates in calling namespace first, then in
clojure.core, then innoahtheduke.splint.rules.helpers. - Rename read-dispatch type from
:varto:binding.
v1.0.1
v1.0.1
Fixed
- Run linting over syntax-quoted forms again.
v1.0
v1.0
I've decided to just release version 1.0. No need to wait around a bunch, better to get to 1.0 and iterate from there.
Added
- Use markdownlint to pretty up the markdown in the repo. Will do my best to keep up with it.
New Rules
style/def-fn: Prefer(let [z f] (defn x [y] (z y)))over(def x (let [z f] (fn [y] (z y))))lint/try-splicing: Prefer(try (do ~@body) (finally ...))over(try ~@body (finally ...)).lint/body-unquote-splicing: Prefer(binding [max mymax] (let [res# (do ~@body)] res#))over(binding [max mymax] ~@body).
Changed
- Add
--paralleland--no-parallelfor running splint in parallel or not. Defaults totrue. - No longer run linting over quoted or syntax-quoted forms.
- Rely on edamame's newly built-in
:unevalconfig option for:splint/disable. - Move version from
build.cljtoresources/SPLINT_VERSION.
Fixed
naming/record-name: Add:message.style/prefer-condp: Only runs if given more than 1 predicate branch.style/set-literal-as-fn: Allow quoted symbols in sets.
v0.1.119
From the changelog:
Added
- The
:new-ruletask now creates a test stub in the correct test directory.
New Rules
lint/duplicate-field-name:(defrecord Foo [a b a])naming/conversion-functions: Should usex->yinstead ofx-to-y.style/set-literal-as-fn: Should use(case elem (a b) true false)instead of(#{'a 'b} elem)
Changed
defrulenow requires the provided rule-name to be fully qualified, and doesn't perform any*ns*magic to derive the genre.- Add support for specifying
:init-typeindefruleto handle symbol matching. - All of the
:dispatchreader macros provided by Edamame now wrap their sexps in the appropriate(splint/X sexp)form, to distinguish them from the symbol forms. Aka#(inc %)is now rendered as(splint/fn [%1] (inc %1)), vs the original(fn* ...), or#'xis now(splint/var x)vs(var x). This allows for writing rules targeting the literal form instead of the symbol form, and requires that rule patterns rely on functions innoahtheduke.splint.rules.helpersto cover these alternates. - Split all rules tests into their own matching namespaces.
- Add
noahtheduke.splint.rules.helpersas an autoresolving namespace so rules can use predicates defined within it without importing or qualifying. - Renamed errors from
violationtodiagnostic. - Merge rules configs into rules maps at load-time.
- Fix typo in README.md by @hkjels in #1
Fixed
lint/duplicate-field-namewasn't checking that?fieldswas a vector before callingcounton it.
New Contributors
Full Changelog: v0.1.94...v0.1.119
v0.1
Use dep directly in bb.edn