summaryrefslogtreecommitdiff
path: root/docs/source/user
diff options
context:
space:
mode:
authorIan Stapleton Cordasco <graffatcolmingov@gmail.com>2018-10-29 15:37:11 +0000
committerIan Stapleton Cordasco <graffatcolmingov@gmail.com>2018-10-29 15:37:11 +0000
commit4439ea202526b50154d287f3e581222a4c86d782 (patch)
treedc0f8312d2dce3a276822947c9391a64ae7e9c8a /docs/source/user
parent732a466ee8eec06d195ec70081e53ec187b5b114 (diff)
parent6ae2295bfeea68c11a7d13282a9bfde1a553449b (diff)
downloadflake8-4439ea202526b50154d287f3e581222a4c86d782.tar.gz
Merge branch 'per-file-style-guide' into 'master'
Add support for per-file ignores in config Closes #156 See merge request pycqa/flake8!259
Diffstat (limited to 'docs/source/user')
-rw-r--r--docs/source/user/options.rst40
1 files changed, 40 insertions, 0 deletions
diff --git a/docs/source/user/options.rst b/docs/source/user/options.rst
index 1cbc22f..00164ae 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`
@@ -422,6 +424,8 @@ Options and their Descriptions
:ref:`Go back to index <top>`
+ .. versionadded:: 3.6.0
+
Specify a list of codes to add to the list of ignored ones. Similar
considerations as in :option:`--ignore` apply here with regard to the
value.
@@ -449,6 +453,40 @@ Options and their Descriptions
extend-ignore = E4,E51,W234
+.. option:: --per-file-ignores=<filename:errors>[ <filename:errors>]
+
+ :ref:`Go back to index <top>`
+
+ .. versionadded:: 3.7.0
+
+ 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>`
@@ -743,6 +781,8 @@ Options and their Descriptions
:ref:`Go back to index <top>`
+ .. versionadded:: 3.6.0
+
Provide extra config files to parse in after and in addition to the files
that |Flake8| found on its own. Since these files are the last ones read
into the Configuration Parser, so it has the highest precedence if it