Flake8: Ignore specific warning for entire file

后端 未结 2 1787
悲哀的现实
悲哀的现实 2021-02-04 22:54

The Ignoring Errors docs currently list a way of ignoring a particular error for a particular line:

example = lambda: \'example\'  # noqa: E731

2条回答
  •  有刺的猬
    2021-02-04 23:44

    Before version 3.7.0, ignoring specific errors was only implemented per-line but not per-file.

    The feature is being tracked and discussed in issue #89 from which only the per-line proposal has been adopted. More recently, an implementation has been proposed in this merge request, which nobody has followed up on.

    However, some extensions have emerged to address the problem:

    • flake8-per-file-ignores lets you ignore specific warning/errors for specific files via an entry in the config.

    • flake8-putty claims to do the same, but hasn't been updated for a while.

提交回复
热议问题