Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

false positive(?) : Static fields should be referenced without parens unless they are intended as function calls #2293

Closed
jasonjckn opened this issue Feb 27, 2024 · 6 comments
Projects

Comments

@jasonjckn
Copy link

jasonjckn commented Feb 27, 2024

  • [X ] I have read the Clojure etiquette and will respect it when communicating on this platform.

[ Is your bug related to macro usage? Consider using a configuration. If not, ignore this section. ]

See config.md for related configuration options.

macos m1

[ Please specify which platform you are using clj-kondo on. Are you using the native version of clj-kondo, or are you running it on the JVM? ]
JVM = zulu 21

clj-kondo v2024.02.12
⚡ which clj-kondo
/opt/homebrew/bin/clj-kondo
⚡ ls -al /opt/homebrew/bin/clj-kondo
⚡ brew search clj-kondo

  • exec /opt/homebrew/bin/brew search clj-kondo
    ==> Formulae
    borkdude/brew/clj-kondo ✔

lrwxr-xr-x@ 44 12 Feb 18:05  /opt/homebrew/bin/clj-kondo -> ../Cellar/clj-kondo/2024.02.12/bin/clj-kondo

[ If applicable, please specify which editor you are using clj-kondo with and which editor plugin you are using. ]

N/A
i'm running clj-kondo from the commmand line
exec /opt/homebrew/bin/clj-kondo --lint ... --config .clj-kondo/config.edn

[ Please provide a short and to the point description of the problem ]

timer.clj:19:19: error: Static fields should be referenced without parens unless they are intended as function calls

false positive?

Thread/interrupted and Thread/sleep are both methods, not fields.

[ Please provide a minimal and complete reproduction of the problem, including a namespace form, which can be pasted in a repro.clj file. Please include the output of the invocation of clj-kondo --lint repro.clj (or .cljs/.cljc) from the command line. ]

config

[ Is your bug related to .clj-kondo/config.edn? Paste your entire
configuration here. Also check if the bug still occurs without using a
configuration, as the bug may be a result of malformed configuration. ]

available upon request.

[ What is the behavior you expected to see from clj-kondo? ]

no errors.

@jasonjckn
Copy link
Author

image

@jasonjckn
Copy link
Author

i also tried {:clj-kondo/ignore [true]} and didn't get suppressed.

@borkdude
Copy link
Member

This is probably already fixed on master, duplicate of #2288

@borkdude
Copy link
Member

Can you provide the code instead of a screenshot perhaps? Where does timer.clj come from?

@borkdude
Copy link
Member

I suppose it's not fixed on master since I can repro this using: (Thread/interrupted). Will look at this tomorrow.

@borkdude borkdude added this to Needs triage in clj-kondo via automation Feb 27, 2024
@borkdude
Copy link
Member

For now you can suppress this with:

 {:linters {:java-static-field-call {:level :off}}

@borkdude borkdude moved this from Needs triage to High priority (next release) in clj-kondo Feb 27, 2024
clj-kondo automation moved this from High priority (next release) to Done Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
clj-kondo
  
Done
Development

No branches or pull requests

2 participants