4

As we all know sometimes it's OK to break the rules. Flycheck Mode however, isn't as forgiving and happily displays it's warning.

Is there a way to disable this on a per line basis when using flake8? For example: Adding a comment # fc:ignore on the same line as a warning you want to ignore.

Bagee
  • 123
  • 1
  • 7

1 Answers1

5

Flycheck does not provide a generic way to ignore warnings, partly because no one implemented that feature yet, but mostly because we do not want to add yet another system to manage warnings to inline comments, configuration files, compiler flags, etc… Warning control is already complicated enough without adding our ingredients to the soup.

Instead, Flycheck relies what the corresponding syntax checker provides for warning control. For some syntax checkers that is a configuration file, for other it's flags to the compiler.

Flake8 specifically allows to inhibit warnings by adding a # noqa comment to the end of the affected line. Alternatively you can ignore specific warnings by disabling them in the configuration file of flake8.

Calaf
  • 483
  • 3
  • 16