aboutsummaryrefslogtreecommitdiff
path: root/tools/patman/checkpatch.py
diff options
context:
space:
mode:
authorDouglas Anderson <dianders@chromium.org>2022-07-19 14:56:27 -0700
committerSimon Glass <sjg@chromium.org>2022-07-26 02:30:56 -0600
commitdce4322c0e1940e11ef9ff086890b8c474707317 (patch)
tree4002e77775a84c8f7fc886e894583308f770b53c /tools/patman/checkpatch.py
parent76656bca9e4d7d7093333a1986c6ebb228571ed6 (diff)
patman: By default don't pass "--no-tree" to checkpatch for linux
When you pass "--no-tree" to checkpatch it disables some extra checks that are important for Linux. Specifically I want checks like: warning: DT compatible string "boogie,woogie" appears un-documented check ./Documentation/devicetree/bindings/ Let's make the default for Linux to _not_ pass --no-tree. We'll have a config option and command line flag to override. Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/checkpatch.py')
-rw-r--r--tools/patman/checkpatch.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/patman/checkpatch.py b/tools/patman/checkpatch.py
index 70ba561c26..d1b902dd96 100644
--- a/tools/patman/checkpatch.py
+++ b/tools/patman/checkpatch.py
@@ -186,7 +186,7 @@ def check_patch_parse(checkpatch_output, verbose=False):
return result
-def check_patch(fname, verbose=False, show_types=False):
+def check_patch(fname, verbose=False, show_types=False, use_tree=False):
"""Run checkpatch.pl on a file and parse the results.
Args:
@@ -194,6 +194,7 @@ def check_patch(fname, verbose=False, show_types=False):
verbose: True to print out every line of the checkpatch output as it is
parsed
show_types: Tell checkpatch to show the type (number) of each message
+ use_tree (bool): If False we'll pass '--no-tree' to checkpatch.
Returns:
namedtuple containing:
@@ -210,7 +211,9 @@ def check_patch(fname, verbose=False, show_types=False):
stdout: Full output of checkpatch
"""
chk = find_check_patch()
- args = [chk, '--no-tree']
+ args = [chk]
+ if not use_tree:
+ args.append('--no-tree')
if show_types:
args.append('--show-types')
output = command.output(*args, fname, raise_on_error=False)
@@ -236,13 +239,13 @@ def get_warning_msg(col, msg_type, fname, line, msg):
line_str = '' if line is None else '%d' % line
return '%s:%s: %s: %s\n' % (fname, line_str, msg_type, msg)
-def check_patches(verbose, args):
+def check_patches(verbose, args, use_tree):
'''Run the checkpatch.pl script on each patch'''
error_count, warning_count, check_count = 0, 0, 0
col = terminal.Color()
for fname in args:
- result = check_patch(fname, verbose)
+ result = check_patch(fname, verbose, use_tree=use_tree)
if not result.ok:
error_count += result.errors
warning_count += result.warnings