I am using flycheck for for Python. I want flycheck
to detect any errors right away when any Python file is opened. Currently it can detect if there is a modification and save operation is performed.
Let's say I have following code in hello.py
file:
#!/usr/bin/env python3
import os
print(os.getpid())
Than I have commented out print(os.getpid())
and close the file and reopened it. At this stage flycheck does not detect that 'os' imported but unused [F401]
. I have to make some moditifications and save the file for it do detect it.
my setup:
(require 'flycheck)
(require 'flycheck-mypy)
(setq python-shell-interpreter "python3"
python-shell-prompt-detect-failure-warning nil
flycheck-python-pycompile-executable "python3"
python-shell-completion-native-enable nil
python-shell-completion-native-disabled-interpreters '("python3")
elpy-shell-echo-output nil ;
)
(add-hook 'python-mode-hook
(lambda ()
;; (setq flycheck-mypyrc "~/venv/bin/pylint")
(setq flycheck-python-pylint-executable "~/venv/bin/pylint")
(local-set-key (kbd "C-c C-b") 'break-point)
(setq flycheck-pylintrc "~/.pylintrc")))
I am also using Getting flycheck “jump to next/previous error” to cycle, it won't also able to detect it till save is done.