Improve documentation on per-file-ignores

Mentions per-file-ignores as possible way to ignore specific rules.
This commit is contained in:
Sorin Sbarnea 2020-01-26 17:46:49 +00:00
parent ebba642268
commit f8b1f2e892
2 changed files with 6 additions and 2 deletions

View file

@ -480,6 +480,7 @@ Options and their Descriptions
W234 W234
extend-ignore = E4,E51,W234 extend-ignore = E4,E51,W234
.. _per-file-ignores:
.. option:: --per-file-ignores=<filename:errors>[ <filename:errors>] .. option:: --per-file-ignores=<filename:errors>[ <filename:errors>]

View file

@ -120,8 +120,11 @@ Ignoring Entire Files
Imagine a situation where we are adding |Flake8| to a codebase. Let's further Imagine a situation where we are adding |Flake8| to a codebase. Let's further
imagine that with the exception of a few particularly bad files, we can add imagine that with the exception of a few particularly bad files, we can add
|Flake8| easily and move on with our lives. There are two ways to ignore the |Flake8| easily and move on with our lives. There are several ways to ignore
file: the file or only rules:
#. Add file patterns and rules to ignore via
:ref:`per-file-ignores <per-file-ignores>` option
#. By explicitly adding it to our list of excluded paths (see: :option:`flake8 #. By explicitly adding it to our list of excluded paths (see: :option:`flake8
--exclude`) --exclude`)