Icaro Motta 0d6c553f3f
Add linter for inconsistent deftest name (#20224)
Adds a new linter to verify all test names are consistent with one common
convention we already follow, for the most part, which is:

> Test vars (test names) should be suffixed with -test.

There's no strong reason for following this convention, although it's quite
common in Clojure, but in any case, these are the reasons I can think of and
remember:

- Naming consistency. Sometimes tests start with "test-", others end with "test"
  and others don't prefix/suffix at all.
- The suffix removes potential conflicts with core Clojure functions.
- The suffix mostly eliminates potential conflicts with other vars in the test
  namespace. Example: you can declare a function delete and have a test named
  delete-test.
- For someone using Emacs imenu feature, it helps differentiate which vars are
  tests and which are just local functions supporting the tests.
2024-06-03 19:10:36 -03:00

12 lines
614 B
Clojure

{:hooks
{:analyze-call
{utils.i18n/label utils.i18n/label
test-helpers.component/get-all-by-translation-text utils.i18n/label
test-helpers.component/get-by-translation-text utils.i18n/label
test-helpers.component/query-all-by-translation-text utils.i18n/label
test-helpers.component/query-by-translation-text utils.i18n/label
cljs.test/deftest cljs.test/deftest}}
:linters {:status-im.linter/invalid-translation-keyword {:level :error}
:status-im.linter/inconsistent-test-name {:level :error}}}