jorgenschaefer / elpy

Emacs Python Development Environment
GNU General Public License v3.0
1.9k stars 261 forks source link

Flake8 5.0 broken #1993

Closed jotsif closed 1 year ago

jotsif commented 2 years ago

Summary

When upgrading to flake8 5.0.x which was released a couple of days ago, flycheck no longer shows flake8 errors. Downgrading to flake8 4.0.1 solves the issue.

Steps to reproduce

Upgrade to flake8 5.0.x

My configuration

OS

MacOS12.4 apple silicon.

Result of (elpy-config)

Elpy Configuration

Emacs.............: 28.1
Elpy..............: 1.35.0
Virtualenv........: .venv (/Users/joseflindmanhornlund/github.com/fluendo/smartcut/.venv)
Interactive Python: python3 3.9.13 (/Users/joseflindmanhornlund/github.com/fluendo/smartcut/.venv/bin/python3)
RPC virtualenv....: .venv (/Users/joseflindmanhornlund/github.com/fluendo/smartcut/.venv)
 Python...........: python 3.9.13 (/Users/joseflindmanhornlund/github.com/fluendo/smartcut/.venv/bin/python)
 Jedi.............: 0.17.2 (0.18.1 available)
 Autopep8.........: 1.6.0
 Yapf.............: Not found (0.32.0 available)
 Black............: 22.6.0
Syntax checker....: flake8 (/Users/joseflindmanhornlund/github.com/fluendo/smartcut/.venv/bin/flake8)

Elpy configuration in my init.el

(use-package elpy
  :ensure t
  :init
  (elpy-enable)
  :config
  (setq elpy-rpc-virtualenv-path 'current))

(add-hook 'elpy-mode-hook (lambda ()
                            (add-hook 'before-save-hook
                                      'elpy-black-fix-code nil t)))

(setq elpy-rpc-backend "jedi")
(setq jedi:complete-on-dot t)
vytas7 commented 2 years ago

Also stumbled upon this, I haven't dug more in depth but the first impression is that flake8 5.0.x+ emits coloured (i.e., with ANSI escape sequences) output indiscriminately which in turn partially confuses flycheck.

vytas7 commented 2 years ago

At least the colour issue might have been already fixed: https://github.com/flycheck/flycheck/issues/1969.

jotsif commented 1 year ago

Works with latest flycheck in my setup. So closing.