active-group / active-group/active-kondo

Left and right hand side in monadic let is considered unused.

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Consider the following example:

```clojure
(ns active-kondo-test.core
(:require [active.clojure.monad :as monad]))

(defn test-f
[arg]
(monad/monadic (let [foo arg])
(monad/return foo)))

(defn -main
[& _]
(println (monad/run-monadic (monad/null-monad-command-config {} {})
(test-f "foo"))))
```

In particular, consider `test-f`. The `arg` parameter as well as the left hand side of the let are obviously used in the expression, yet, `clj-kondo` reports both of them as unused.

```shell
$ clj-kondo --version
clj-kondo v2022.04.23
$ clj-kondo --lint src --config active-kondo/config.edn
src/active_kondo_test/core.clj:5:4: warning: unused binding arg
src/active_kondo_test/core.clj:7:32: error: Unresolved symbol: foo
linting took 130ms, errors: 1, warnings: 1
```

It's possible I'm not calling `clj-kondo` correctly (the `--config` syntax seems to be fine as described [here](https://github.com/clj-kondo/clj-kondo/blob/master/doc/config.md#introduction)).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.