status-react/.clj-kondo/config.edn

76 lines
5.1 KiB
Clojure
Raw Normal View History

{:config-paths ["status-im"]
:lint-as {status-im.utils.views/defview clojure.core/defn
status-im.utils.views/letsubs clojure.core/let
reagent.core/with-let clojure.core/let
status-im.utils.fx/defn clj-kondo.lint-as/def-catch-all
utils.re-frame/defn clj-kondo.lint-as/def-catch-all
quo.react/with-deps-check clojure.core/fn
quo.previews.preview/list-comp clojure.core/for
status-im.utils.styles/def clojure.core/def
status-im.utils.styles/defn clojure.core/defn
test-helpers.unit/deftest-sub clojure.core/defn
taoensso.tufte/defnp clojure.core/defn}
Upgrade clj-kondo and configure new linters (#17543) - Upgrade clj-kondo to latest version to take advantage of new linters. From version 2023.04.14 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230414 to 2023.09.07 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907 - Use new linter ":unused-alias" and set at WARN level for the moment, because otherwise the PR would increase a bit too much, but it did catch many unused "require" aliases. Added in version 2023.09.07 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907 - Use new linter ":case-symbol-test" and fix the reported errors, added in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Use new linters ":equals-true", ":plus-one", and ":minus-one" and fix reported errors, added in version 2023.05.18 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230518 - Raise level from WARN to ERROR for linter "uninitialized-var". - Explicitly add ":case-duplicate-test" to clj-kondo config, renamed in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Explicitly add ":case-quoted-test" to clj-kondo config, renamed in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Explicitly add ":deprecated-namespace" to clj-kondo config, added in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 Fixes https://github.com/status-im/status-mobile/issues/17287
2023-10-05 18:50:57 +00:00
:linters {:case-duplicate-test {:level :error}
:case-quoted-test {:level :error}
:case-symbol-test {:level :error}
:clj-kondo-config {:level :error}
:cond-else {:level :error}
:consistent-alias {:level :error
Introduce malli library (#17867) This commit is the foundational step to start using malli (https://github.com/metosin/malli) in this project. Take in consideration we will only be able to realize malli's full power in future iterations. For those without context: the mobile team watched a presentation about malli and went through a light RFC to put everyone on the same page, among other discussions here and there in PRs. To keep things relatively short: 1. Unit, integration and component tests will short-circuit (fail) when inputs/outputs don't conform to their respective function schemas (CI should fail too). 2. Failed schema checks will not block the app from initializing, nor throw an exception that would trigger the LogBox. Exceptions are only thrown in the scope of automated tests. 3. There's zero performance impact in production code because we only instrument. Instrumentation is removed from the compiled code due to the usage of "^boolean js.goog/DEBUG". 4. We shouldn't expect any meaningful slowdown during development. **What are we instrumenting in this PR?** Per our team's agreement, we're only instrumenting the bare minimum to showcase 2 examples. - Instrument a utility function utils.money/format-amount using the macro approach. - Instrument a quo component quo.components.counter.step.view/view using the functional approach. Both approaches are useful, the functional approach is powerful and allow us to instrument anonymous functions, like the ones we pass to subscriptions or event handlers, or the higher-order function quo.theme/with-theme. The macro approach is perfect for functions already defined with defn. **I evaluated the schema or function in the REPL but nothing changes** - If you evaluate the source function, you need to evaluate schema/=> or schema/instrument as well. - Remember to *var quote* when using schema/instrument. - You must call "(status-im2.setup.schema/setup!)" after any var is re-instrumented. It's advisable to add a keybinding in your editor to send this expression automatically to the CLJS REPL, or add the call at the end of the namespace you are working on (similar to how some devs add "(run-tests)" at the end of test namespaces). **Where should schemas be defined?** For the moment, we should focus on instrumenting quo components, so define each function schema in the same namespace as the component's public "view" var. To be specific: - A schema used only to instrument a single function and not used elsewhere, like a quo component schema, wouldn't benefit from being defined in a separate namespace because that would force the developer to constantly open two files instead of one to check function signatures. - A common schema reused across the repo, like ":schema.common/theme" should be registered in the global registry "schema.registry" so that consumers can just refer to it by keyword, as if it was a built-in malli schema. - A common schema describing status-go entities like message, notification, community, etc can be stored either in the respective "src/status_im2/contexts/*" or registered globally, or even somewhere else. This is yet to be defined, but since I chose not to include schemas for them, we can postpone this guideline.
2023-11-18 14:04:48 +00:00
:aliases {clojure.set set
clojure.string string
clojure.walk walk
malli.core malli
malli.dev.pretty malli.pretty
malli.dev.virhe malli.virhe
malli.error malli.error
malli.generator malli.generator
malli.transform malli.transform
malli.util malli.util
schema.core schema
taoensso.timbre log}}
Upgrade clj-kondo and configure new linters (#17543) - Upgrade clj-kondo to latest version to take advantage of new linters. From version 2023.04.14 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230414 to 2023.09.07 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907 - Use new linter ":unused-alias" and set at WARN level for the moment, because otherwise the PR would increase a bit too much, but it did catch many unused "require" aliases. Added in version 2023.09.07 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907 - Use new linter ":case-symbol-test" and fix the reported errors, added in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Use new linters ":equals-true", ":plus-one", and ":minus-one" and fix reported errors, added in version 2023.05.18 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230518 - Raise level from WARN to ERROR for linter "uninitialized-var". - Explicitly add ":case-duplicate-test" to clj-kondo config, renamed in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Explicitly add ":case-quoted-test" to clj-kondo config, renamed in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Explicitly add ":deprecated-namespace" to clj-kondo config, added in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 Fixes https://github.com/status-im/status-mobile/issues/17287
2023-10-05 18:50:57 +00:00
:deprecated-namespace {:level :warning}
:docstring-blank {:level :error}
Upgrade clj-kondo and configure new linters (#17543) - Upgrade clj-kondo to latest version to take advantage of new linters. From version 2023.04.14 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230414 to 2023.09.07 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907 - Use new linter ":unused-alias" and set at WARN level for the moment, because otherwise the PR would increase a bit too much, but it did catch many unused "require" aliases. Added in version 2023.09.07 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907 - Use new linter ":case-symbol-test" and fix the reported errors, added in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Use new linters ":equals-true", ":plus-one", and ":minus-one" and fix reported errors, added in version 2023.05.18 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230518 - Raise level from WARN to ERROR for linter "uninitialized-var". - Explicitly add ":case-duplicate-test" to clj-kondo config, renamed in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Explicitly add ":case-quoted-test" to clj-kondo config, renamed in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Explicitly add ":deprecated-namespace" to clj-kondo config, added in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 Fixes https://github.com/status-im/status-mobile/issues/17287
2023-10-05 18:50:57 +00:00
:equals-true {:level :error}
:inline-def {:level :error}
:invalid-arity {:skip-args [status-im.utils.fx/defn utils.re-frame/defn]}
:loop-without-recur {:level :error}
Upgrade clj-kondo and configure new linters (#17543) - Upgrade clj-kondo to latest version to take advantage of new linters. From version 2023.04.14 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230414 to 2023.09.07 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907 - Use new linter ":unused-alias" and set at WARN level for the moment, because otherwise the PR would increase a bit too much, but it did catch many unused "require" aliases. Added in version 2023.09.07 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907 - Use new linter ":case-symbol-test" and fix the reported errors, added in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Use new linters ":equals-true", ":plus-one", and ":minus-one" and fix reported errors, added in version 2023.05.18 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230518 - Raise level from WARN to ERROR for linter "uninitialized-var". - Explicitly add ":case-duplicate-test" to clj-kondo config, renamed in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Explicitly add ":case-quoted-test" to clj-kondo config, renamed in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Explicitly add ":deprecated-namespace" to clj-kondo config, added in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 Fixes https://github.com/status-im/status-mobile/issues/17287
2023-10-05 18:50:57 +00:00
:minus-one {:level :error}
:misplaced-docstring {:level :error}
:missing-body-in-when {:level :error}
:missing-clause-in-try {:level :error}
:missing-else-branch {:level :error}
:not-empty? {:level :error}
Upgrade clj-kondo and configure new linters (#17543) - Upgrade clj-kondo to latest version to take advantage of new linters. From version 2023.04.14 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230414 to 2023.09.07 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907 - Use new linter ":unused-alias" and set at WARN level for the moment, because otherwise the PR would increase a bit too much, but it did catch many unused "require" aliases. Added in version 2023.09.07 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907 - Use new linter ":case-symbol-test" and fix the reported errors, added in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Use new linters ":equals-true", ":plus-one", and ":minus-one" and fix reported errors, added in version 2023.05.18 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230518 - Raise level from WARN to ERROR for linter "uninitialized-var". - Explicitly add ":case-duplicate-test" to clj-kondo config, renamed in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Explicitly add ":case-quoted-test" to clj-kondo config, renamed in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Explicitly add ":deprecated-namespace" to clj-kondo config, added in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 Fixes https://github.com/status-im/status-mobile/issues/17287
2023-10-05 18:50:57 +00:00
:plus-one {:level :error}
:redundant-do {:level :error}
:redundant-let {:level :error}
:refer-all {:level :error}
:shadowed-var {:level :error
;; We temporarily use :include to define an
;; allowlist of core Clojure vars. In the
;; future, as we progressively fix shadowed
;; vars, we should be able to delete this
;; option and lint all vars.
:exclude [type name]}
:single-operand-comparison {:level :error}
:syntax {:level :error}
:unbound-destructuring-default {:level :error}
:uninitialized-var {:level :error}
:unknown-require-option {:level :error}
:unreachable-code {:level :error}
:unresolved-namespace {:level :error}
;; TODO remove number when this is fixed
;; https://github.com/borkdude/clj-kondo/issues/867
:unresolved-symbol {:exclude [PersistentPriorityMap.EMPTY
number
status-im.test-helpers/restore-app-db]}
:unresolved-var {:level :error}
:unsorted-required-namespaces {:level :error}
Upgrade clj-kondo and configure new linters (#17543) - Upgrade clj-kondo to latest version to take advantage of new linters. From version 2023.04.14 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230414 to 2023.09.07 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907 - Use new linter ":unused-alias" and set at WARN level for the moment, because otherwise the PR would increase a bit too much, but it did catch many unused "require" aliases. Added in version 2023.09.07 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230907 - Use new linter ":case-symbol-test" and fix the reported errors, added in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Use new linters ":equals-true", ":plus-one", and ":minus-one" and fix reported errors, added in version 2023.05.18 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230518 - Raise level from WARN to ERROR for linter "uninitialized-var". - Explicitly add ":case-duplicate-test" to clj-kondo config, renamed in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Explicitly add ":case-quoted-test" to clj-kondo config, renamed in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 - Explicitly add ":deprecated-namespace" to clj-kondo config, added in version 2023.07.13 https://github.com/clj-kondo/clj-kondo/blob/master/CHANGELOG.md#20230713 Fixes https://github.com/status-im/status-mobile/issues/17287
2023-10-05 18:50:57 +00:00
:unused-alias {:level :warning}
:unused-binding {:level :error}
:unused-import {:level :error}
:unused-namespace {:level :error}
:unused-private-var {:level :error}
:unused-referred-var {:level :error}
:use {:level :error}}
:config-in-ns {mocks.js-dependencies {:linters {:clojure-lsp/unused-public-var {:level :off}}}}}