erickgnavar / flymake-ruff

flymake plugin for ruff linter
GNU General Public License v3.0
37 stars 6 forks source link

flymake-ruff shows warnings in other modes #16

Closed schmir closed 7 months ago

schmir commented 7 months ago

I'm using eglot and both python and clojure modes. I've configured flymake-ruff according to the documentation with

(add-hook 'eglot-managed-mode-hook 'flymake-ruff-load)

I end up with ruff warnings for my clojure code! When I use the following code, everything works as expected:

  (add-hook 'eglot-managed-mode-hook
            (lambda()
              (when (derived-mode-p 'python-base-mode)
                (flymake-ruff-load))))
erickgnavar commented 7 months ago

Hi, thanks for reporting this, can you make a PR to fix that in the documentation?

schmir commented 7 months ago

I did dig a bit deeper into the issue. There was already PR #9 that tried to fix the issue with this commit.

I did find the following blog post on flymake-clippy, which describes the actual problem. The flymake-clippy readme contains instructions on how to setup the plugin with eglot.

erickgnavar commented 7 months ago

I added the change from the PR your mentioned, thanks for the report