summaryrefslogtreecommitdiff
path: root/docs/source/user
diff options
context:
space:
mode:
authorIan Stapleton Cordasco <graffatcolmingov@gmail.com>2018-10-27 07:51:55 -0500
committerIan Stapleton Cordasco <graffatcolmingov@gmail.com>2018-10-27 11:35:07 -0500
commit19148eb5d74684dbaa249619a1b60325ffc5f7ac (patch)
tree16fe82326d00777629c095fa80a7d3b7fd507929 /docs/source/user
parente09a22a416b61f242feb90d8a536286713d0ab7e (diff)
downloadflake8-19148eb5d74684dbaa249619a1b60325ffc5f7ac.tar.gz
Add documentation for --per-file-ignores
Diffstat (limited to 'docs/source/user')
-rw-r--r--docs/source/user/options.rst34
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/source/user/options.rst b/docs/source/user/options.rst
index 1cbc22f..cb3e949 100644
--- a/docs/source/user/options.rst
+++ b/docs/source/user/options.rst
@@ -58,6 +58,8 @@ Index of Options
- :option:`flake8 --extend-ignore`
+- :option:`flake8 --per-file-ignores`
+
- :option:`flake8 --max-line-length`
- :option:`flake8 --select`
@@ -449,6 +451,38 @@ Options and their Descriptions
extend-ignore = E4,E51,W234
+.. option:: --per-file-ignores=<filename:errors>[ <filename:errors>]
+
+ :ref:`Go back to index <top>`
+
+ Specify a list of mappings of files and the codes that should be ignored
+ for the entirety of the file. This allows for a project to have a default
+ list of violations that should be ignored as well as file-specific
+ violations for files that have not been made compliant with the project
+ rules.
+
+ This option supports syntax similar to :option:`--exclude` such that glob
+ patterns will also work here.
+
+ This can be combined with both :option:`--ignore` and
+ :option:`--extend-ignore` to achieve a full flexibility of style options.
+
+ Command-line usage:
+
+ .. prompt:: bash
+
+ flake8 --per-file-ignores='project/__init__.py:F401 setup.py:E121'
+ flake8 --per-file-ignores='project/*/__init__.py:F401 setup.py:E121'
+
+ This **can** be specified in config files.
+
+ .. code-block:: ini
+
+ per-file-ignores =
+ project/__init__.py:F401
+ setup.py:E121
+ other_project/*:W9
+
.. option:: --max-line-length=<n>
:ref:`Go back to index <top>`