From 8034c659d3bae041009578779211328b43640b61 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Fri, 27 Oct 2023 17:37:08 +0200 Subject: [PATCH] Disable condition-always-true linter for now --- doc/linters.md | 6 ++++-- src/clj_kondo/impl/config.clj | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/linters.md b/doc/linters.md index a6881cc4b2..c4ef1e5965 100644 --- a/doc/linters.md +++ b/doc/linters.md @@ -15,6 +15,7 @@ configuration. For general configurations options, go [here](config.md). - [Case symbol test constant](#case-symbol-test-constant) - [Clj-kondo config](#clj-kondo-config) - [Cond-else](#cond-else) + - [Condition always true](#condition-always-true) - [Conflicting-alias](#conflicting-alias) - [Consistent-alias](#consistent-alias) - [Datalog syntax](#datalog-syntax) @@ -239,9 +240,10 @@ enabling this linter, you can prepend the `case` expression with *Keyword:* `:condition-always-true`. *Description:* warn on a condition that evaluates to an always truthy constant, -like when passing a function instead of calling it +like when passing a function instead of calling it. This linter intentionally +doesn't check for literally `true` values of vars since this is often a dev/production setting. -*Default level:* `:warning`. +*Default level:* `:off` (will be `:warning` in a future release). *Example trigger:* `(if odd? :odd :even)`. diff --git a/src/clj_kondo/impl/config.clj b/src/clj_kondo/impl/config.clj index 5edfb51a60..91bb9d8e44 100644 --- a/src/clj_kondo/impl/config.clj +++ b/src/clj_kondo/impl/config.clj @@ -156,7 +156,7 @@ :protocol-method-varargs {:level :error} :unused-alias {:level :off} :self-requiring-namespace {:level :off} - :condition-always-true {:level :warning}} + :condition-always-true {:level :off}} ;; :hooks {:macroexpand ... :analyze-call ...} :lint-as {cats.core/->= clojure.core/-> cats.core/->>= clojure.core/->>