From 2248c7ac0d03022c2a8b663bf3fab53601e33e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20H=C3=B6nig?= Date: Mon, 11 Sep 2017 19:48:19 +0200 Subject: [PATCH] linter: Add explanation for custom rule file delimitation operators. --- tools/linter_lib/custom_check.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index 39f55c1fc6..89db2d1298 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -103,6 +103,12 @@ def build_custom_checkers(by_lang): return failed + # By default, a rule applies to all files within the extension for which it is specified (e.g. all .py files) + # There are three operators we can use to manually include or exclude files from linting for a rule: + # 'exclude': 'set([, ...])' - if is a filename, excludes that file. + # if is a directory, excludes all files directly below the directory . + # 'exclude_line': 'set([(, ), ...])' - excludes all lines matching in the file from linting. + # 'include_only': 'set([, ...])' - includes only those files where is a substring of the filepath. trailing_whitespace_rule = { 'pattern': '\s+$', 'strip': '\n',