Closed synic closed 2 years ago
try M-x flycheck-select-checker and choose python-flake8
@lebensterben This does work, thanks! How do I get it to automatically select python-flake8
?
I've got this setup in my .dir-locals.el
:
((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
set flycheck-checker
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"
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.
Description :octocat:
LSP and Python: flake8 settings are not honored
Reproduction guide :beetle:
pythonlsptest
git init
Create a
.flake8
configuration with the following contents:Create a python file with a function in it:
Observed behaviour: :eyes: :broken_heart:
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: :heart: :smile:
The flake8 configuration should be honored like it is in
company-mode
System Info :computer:
Backtrace :paw_prints: