Skip to content

Releases: NoahTheDuke/splint

v1.2.0

07 Apr 03:04

Choose a tag to compare

Added

  • markdown output: Same text as full but with a fancy horizontal bar, header, and code blocks.
  • :chosen-style allows for rules to have configuration and different "styles". The first supported is lint/not-empty? showing either seq or not-empty.

Changed

  • ctx is no longer an atom, but a plain map. The :diagnostics entry is now the atom.
  • splint.runner/check-form returns the entire updated ctx object instead of just the diagnostics. (I'm not entirely sure that's reasonable, but it's easily changed.)
  • Move a lot of rules from lint to style genre:
    • apply-str
    • apply-str-interpose
    • apply-str-reverse
    • assoc-assoc
    • conj-vector
    • eq-false
    • eq-nil
    • eq-true
    • eq-zero
    • filter-complement
    • filter-vec-filterv
    • first-first
    • first-next
    • let-do
    • mapcat-apply-apply
    • mapcat-concat-map
    • minus-one
    • minus-zero
    • multiply-by-one
    • multiply-by-zero
    • neg-checks
    • nested-addition
    • nested-multiply
    • next-first
    • next-next
    • not-eq
    • not-nil
    • not-some-pred
    • plus-one
    • plus-zero
    • pos-checks
    • tostring
    • update-in-assoc
    • useless-do
    • when-do
    • when-not-call
    • when-not-do
    • when-not-empty
    • when-not-not

Breaking

  • Add ctx as first argument to :on-match functions to pass in config to rules. Update functions in splint.runner as necessary.

v1.1.1

31 Mar 20:13

Choose a tag to compare

Changed

  • Update Rule Documentation.
  • Include new documentation in cljdoc.edn

v1.1.0

31 Mar 20:03

Choose a tag to compare

Added

  • Write documentation for rules and patterns.
  • Write docstrings for a bunch of noahtheduke.spat.pattern functions.
  • Include outside links in config in rules docs.
  • Check :spat/lit metadata 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 in noahtheduke.splint.rules.helpers.
  • Rename read-dispatch type from :var to :binding.

v1.0.1

22 Mar 14:14

Choose a tag to compare

v1.0.1

Fixed

  • Run linting over syntax-quoted forms again.

v1.0

22 Mar 13:49

Choose a tag to compare

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 --parallel and --no-parallel for running splint in parallel or not. Defaults to true.
  • No longer run linting over quoted or syntax-quoted forms.
  • Rely on edamame's newly built-in :uneval config option for :splint/disable.
  • Move version from build.clj to resources/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

17 Mar 03:45

Choose a tag to compare

From the changelog:

Added

  • The :new-rule task 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 use x->y instead of x-to-y.
  • style/set-literal-as-fn: Should use (case elem (a b) true false) instead of (#{'a 'b} elem)

Changed

  • defrule now 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-type in defrule to handle symbol matching.
  • All of the :dispatch reader 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 #'x is 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 in noahtheduke.splint.rules.helpers to cover these alternates.
  • Split all rules tests into their own matching namespaces.
  • Add noahtheduke.splint.rules.helpers as an autoresolving namespace so rules can use predicates defined within it without importing or qualifying.
  • Renamed errors from violation to diagnostic.
  • Merge rules configs into rules maps at load-time.
  • Fix typo in README.md by @hkjels in #1

Fixed

  • lint/duplicate-field-name wasn't checking that ?fields was a vector before calling count on it.

New Contributors

  • @hkjels made their first contribution in #1

Full Changelog: v0.1.94...v0.1.119

v0.1

16 Feb 22:16

Choose a tag to compare

Use dep directly in bb.edn