From f8b1f2e892fd2f7e6558992d744c50fe481f6423 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Sun, 26 Jan 2020 17:46:49 +0000 Subject: [PATCH] Improve documentation on per-file-ignores Mentions per-file-ignores as possible way to ignore specific rules. --- docs/source/user/options.rst | 1 + docs/source/user/violations.rst | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/source/user/options.rst b/docs/source/user/options.rst index ab5cf29..f294ccb 100644 --- a/docs/source/user/options.rst +++ b/docs/source/user/options.rst @@ -480,6 +480,7 @@ Options and their Descriptions W234 extend-ignore = E4,E51,W234 +.. _per-file-ignores: .. option:: --per-file-ignores=[ ] diff --git a/docs/source/user/violations.rst b/docs/source/user/violations.rst index 8681276..0baec56 100644 --- a/docs/source/user/violations.rst +++ b/docs/source/user/violations.rst @@ -120,8 +120,11 @@ Ignoring Entire Files 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 -|Flake8| easily and move on with our lives. There are two ways to ignore the -file: +|Flake8| easily and move on with our lives. There are several ways to ignore +the file or only rules: + +#. Add file patterns and rules to ignore via + :ref:`per-file-ignores ` option #. By explicitly adding it to our list of excluded paths (see: :option:`flake8 --exclude`)