NoahTheDuke / lazytest

A standalone BDD test framework for Clojure
https://cljdoc.org/d/io.github.noahtheduke/lazytest
Eclipse Public License 1.0
12 stars 0 forks source link

Los Angeles Meetup Thoughts: clj-kondo config #3

Closed NoahTheDuke closed 1 day ago

NoahTheDuke commented 2 days ago

From the slack channel:

Probably my final comment tonight(!), in the exported clj-kondo config, you have :lint-as

lazytest.core/defdescribe clojure.core/def

but I think

lazytest.core/defdescribe clojure.test/deftest

would be better? Otherwise it complains that a docstring is missing (and not all defdescribe have symbol followed by string, right?)

NoahTheDuke commented 2 days ago

The decision to use def was to make linting docstrings simple. However, this clashes if the clj-kondo linter :missing-docstrings is set to :info or higher.

Alternatively, we could use clojure.test/deftest, but then that should warn for :unused-value on the docstring if it's provided (it currently doesn't, but I suspect that's a clj-kondo bug).

The third option is to write a custom clj-kondo hook, which would cover this. Maybe just wrap the docstring in a comment block? I need to think about this.

NoahTheDuke commented 1 day ago

Wrote a custom hook in https://github.com/NoahTheDuke/lazytest/commit/2223d91933dc837bf39e940a019e1ec8621931e2.