Replies: 5 comments 3 replies
-
try M-x flycheck-select-checker and choose python-flake8 |
Beta Was this translation helpful? Give feedback.
-
@lebensterben This does work, thanks! How do I get it to automatically select I've got this setup in my ((python-mode
(eval . (python-black-on-save-mode))
(fill-column . 88)
(auto-fill-mode . -1)
(flycheck--automatically-disabled-checkers . '(python-pylint lsp python-pycompile))
(flycheck--automatically-enabled-checkers . '(python-flake8))
(flycheck-add-next-checker 'python-flake8 'lsp)
))
but it sure doesn't want to disable lsp as a checker |
Beta Was this translation helpful? Give feedback.
-
set flycheck-checker |
Beta Was this translation helpful? Give feedback.
-
It doesn't work, for some reason lsp gets enabled by default, even with the following: ((python-mode
(eval . (python-black-on-save-mode))
(fill-column . 88)
(auto-fill-mode . -1)
(flycheck-flake8rc . "/home/synic/Projects/defiq-coinprice-lambda/.flake8")
(lsp-pylsp-plugins-flake8-config . "/home/synic/Projects/defiq-coinprice-lambda/.flake8")
(flycheck-checker . 'python-flake8)
)) I've got this in my spacemacs config as well: (add-hook 'python-mode-hook
(lambda ()
;; Enable fill column indicator
;; (display-fill-column-indicator-mode)
(display-fill-column-indicator-mode)
;; Turn on line numbering
;; (linum-mode t)
(setq fill-column 79)
;; set in-block indentation scale
(setq python-indent-def-block-scale 1)
;; Set tab-width to 4
(setq tab-width 4
evil-shift-width 4)
(setq flycheck-checker 'python-flake8)
;; Enable automatic line wrapping at fill column
(auto-fill-mode t)))
When I check the flycheck setup, is shows lsp as "explicitly selected" |
Beta Was this translation helpful? Give feedback.
-
lsp blackend is enabled whenever lsp layer is enabled. you have to explicitly set python layer variable to disable it. this is not a bug and I'm transferring it to discussion. |
Beta Was this translation helpful? Give feedback.
-
Description
LSP and Python: flake8 settings are not honored
Reproduction guide 🪲
Start Emacs
Create a new directory, something like
pythonlsptest
In the directory, type
git init
Create a
.flake8
configuration with the following contents:Create a python file with a function in it:
Observed behaviour: 👀 💔
Emacs ignores the flake8 configuration. Errors that are set to be ignored
(for example,
D100
,D103
) are shown in flyckeck.I have tried telling LSP where the configuration file is using
.dir-locals.el
:However, this appears to have no effect.
Expected behaviour: ❤️ 😄
The flake8 configuration should be honored like it is in
company-mode
System Info 💻
Backtrace 🐾
Beta Was this translation helpful? Give feedback.
All reactions