I'm using elpy to code in Python, along with flymake to help with style/syntax checking.

The problem being that I have my habit, and I like to sometimes put 2 blank lines between methods of the same class, which inevitably triggers the following :

E303 : too many blank lines (2).

Now I'd like, or to have flymake ignore this specific error, or to edit the file where these rules are written, to trigger for instance a warning from 3 blank lines, and not 2.

How could I do that ?


Edit : I'm using GNU emacs 24.5.1 on Ubuntu 16.04

1 Answer 1


flymake uses flake8 to check the errors, so you have to tell flake8 which errors you don't want to see. You can do that globally by creating the file ~/.config/flake8, with the following content:

ignore = E303

You can also create a setup.cfg at the root of your project, with the same syntax, to have different settings per project.

Make sure to restart flymake after changing flake's config.

  • What if there are multiple rules that I want to ignore?
    – alper
    Jan 4, 2020 at 20:26
  • 1
    @alper you can use comma for that, like this: ignore = E303,E304
    – Jesse
    Jan 5, 2020 at 17:24
  • Just in case I end up here again Configuring Flake8
    – Jim
    Jan 26, 2023 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.