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

89 lines
6.1 KiB
Clojure
Raw Normal View History

{:config-paths ["status-im"]
:output {:exclude-files ["src/user.cljs" "src/dev/user.cljs"]}
2023-12-19 17:41:30 +00:00
:lint-as {legacy.status-im.utils.views/defview clojure.core/defn
legacy.status-im.utils.views/letsubs clojure.core/let
reagent.core/with-let clojure.core/let
legacy.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
legacy.status-im.utils.styles/def clojure.core/def
legacy.status-im.utils.styles/defn clojure.core/defn
test-helpers.unit/deftest-sub clojure.core/defn
chore(tests)_: Facilitate writing event tests (#20424) Introduces a new macro deftest-event to facilitate writing tests for event handlers. Motivation came from the _problem of having to always extract event handlers as vars in order to test them_. Although the implementation of deftest-sub and deftest-event are similar, deftest-sub is critically important because it guarantees changes in one subscription can be caught by tests from all other related subscriptions in the graph (reference: PR https://github.com/status-im/status-mobile/pull/14472). This is not the case for the new deftest-event macro. deftest-event is essentially a way of make testing events less ceremonial by not requiring event handlers to be extracted to vars. But there are a few other small benefits: - The macro uses re-frame and "finds" the event handler by computing the interceptor chain (except :do-fx), so in a way, the tests are covering a bit more ground. - Slightly easier way to find event tests in the repo since you can just find references to deftest-event. - Possibly slightly easier to maintain by devs because now event tests and sub tests are written in a similar fashion. - Less code diff. Whether an event has a test or not, there's no var to add/remove. - The dispatch function provided by the macro makes reading the tests easier over time. For example, when we read subscription tests, the Act section of the test is always the same (rf/sub [sub-name]). Similarly for events, the Act section is always (dispatch [event-id arg1 arg2]). - Makes the re-frame code look more idiomatic because it's more common to define handlers as anonymous functions. Downside: deftest-sub and deftest-event are relatively complicated macros. Note: The test suite runs just as fast and clj-kondo can lint code within the macro just as well. Before: ```clojure (deftest process-account-from-signal-test (testing "process account from signal" (let [cofx {:db {:wallet {:accounts {}}}} effects (events/process-account-from-signal cofx [raw-account]) expected-effects {:db {:wallet {:accounts {address account}}} :fx [[:dispatch [:wallet/get-wallet-token-for-account address]] [:dispatch [:wallet/request-new-collectibles-for-account-from-signal address]] [:dispatch [:wallet/check-recent-history-for-account address]]]}] (is (match? expected-effects effects))))) ``` After ```clojure (h/deftest-event :wallet/process-account-from-signal [event-id dispatch] (let [expected-effects {:db {:wallet {:accounts {address account}}} :fx [[:dispatch [:wallet/get-wallet-token-for-account address]] [:dispatch [:wallet/request-new-collectibles-for-account-from-signal address]] [:dispatch [:wallet/check-recent-history-for-account address]]]}] (reset! rf-db/app-db {:wallet {:accounts {}}}) (is (match? expected-effects (dispatch [event-id raw-account]))))) ```
2024-06-14 01:03:02 +00:00
test-helpers.unit/deftest-event clojure.core/defn
2023-12-19 17:41:30 +00:00
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}
:condition-always-true {:level :error}
:conflicting-alias {:level :error}
:consistent-alias {:level :error
: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
promesa.core promesa
schema.core schema
status-im.feature-flags ff
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}
2023-12-19 17:41:30 +00:00
:invalid-arity {:skip-args [legacy.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}
:multiple-async-in-deftest {: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-fn-param {: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]}
:self-requiring-namespace {:level :error}
:single-operand-comparison {:level :error}
:syntax {:level :error}
:unbound-destructuring-default {:level :error}
:underscore-in-namespace {: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
Update release branch 2.30.x (#20903) Revisions from develop: - 59ceddbaa develop origin/develop fix(wallet): fix bridge transactions (#20902) - 99ccbc338 Cover wallet send events with tests Part 2 #20411 #20533 (#20721) - 8c2d5398b Enabling WalletConnect feature flag (#20906) - 67c83b13e fix(wallet): remove edit routes button in bridging (#20874) - 11a84ba14 feat(wallet): disable complex routing (#20901) - 1f5bb579c chore(wallet): disable bridging on unsupported tokens (#20846) - 4586f8007 Add toggle in advanced settings for mobile data - 55c620e59 fix: create password for small screen (#20645) - 525609f0a Wallet Activity: transactions are not sorted by time #20808 (#20862) - 90653955a chore(settings): Disable telemetry option (#20881) - d27ab756d fix_:display group message using the new ui (#20787) - c6a1db633 ci: enable split apks & build only for arm64-v8a (#20683) - 73777e052 Ensure keycard account can send transaction after upgrading from v1 to v2 #20552 (#20845) - a6d3fc374 [#20524] fix: the missed keypairs are shown in the key pair list screen (#20888) - a671c7083 fix broken screen and navigation when syncing fails (#20887) - a45991b6d 🥅 Filter connected dapps based on testnet mode, reject proposals and requests gracefully (#20799) - 2e9fa22e4 feat: wallet router v2 (#20631) - 737d8c4d5 rename sub to fix error when requesting to join community (#20868) - 3aa7e103f Sync process is blocked on Enabled notifications screen (#20883) - c1d2d44da perf: Fix app freeze after login (#20729) - 0fed8113d e2e: updated testnet switching and added one test into smoke - 53c35cb55 fix(wallet): Linear gradient exception on invalid colors for watched account cards (#20854) - be8236554 chore(settings)_: Remove testnet toggle from legacy advanced settings (#20875) - eae8a6559 feat(wallet)_: Add beta info box in activity tab (#20873) - fe54a25a3 fix: not clearing network & web3-wallet on logout (#20886) - 15a4219ef Reject wallet-connect request by dragging the modal down (#20763) (#20836) - 2ffbdac89 WalletConnect show expired toast (#20857) - 402eb8397 fix Issue with scrolling WalletConnect transaction on Android (#20867) - ff88049a0 Fix WalletConnect header alignment on Android (#20860) - cee21241d WalletConnect no internet edge-cases (#20826) - 60ad7c8a2 chore(tests): New match-strict? cljs.test directive (#20825) - 4989c9278 fix_: Adding own address as saved addresses (#20839)
2024-07-30 14:28:07 +00:00
legacy.status-im.test-helpers/restore-app-db
(cljs.test/is [match-strict?])]}
: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}}}}}