clj-python / clj-python/libpython-clj
py. syntax is doing weird things with the clj-kondo linter
Nobody has claimed this yet.
- Dominant language
- Clojure
- Stars
- 1.2k
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Description
The linter is doing something weird, because it assumes that py/py. is actually a reference to the symbol "py/py" with no ".".
I'm unable to write a custom :lint-as for this, because clj-kondo doesn't consider the possibility that "py." could represent a macro. ingoring :unresolved-var doesn't quite fill my usecase, as I want to remove the red squiglies under the second argument of the py. call as well.
I think clj-kondo is technically in the right here, because py. isn't supported clojure syntax, although I do like the py. notation, and it'd be nice if it was supported. I don't ask to change the notation, but it'd be nice to have a workaround that fixes these tooling issues.
https://clojure.org/reference/reader#_reader_forms
Symbols beginning or ending with '.' are reserved by Clojure.
Great Library! -- Sammy
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the py/py. call with clj-kondo, comparing the behavior of a custom :lint-as with :unresolved-var suppression. No implementation file or test is named; trace how clj-kondo parses the reserved py. notation and define completion as a workable lint configuration or documented support that removes both reported squiggles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure, python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100