diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-01-19 08:33:48 -0700 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-01-19 08:33:48 -0700 |
commit | ee94b3e8bf659c847bda967700272f8f98fdb0cc (patch) | |
tree | b2eb4585705b7b71229647ed2d77289d00474f75 /python | |
parent | f3dfe04fa45bd723fac40d1452550d55240f80f8 (diff) | |
parent | 394f8163433559cea294cb4a4e335cc43ccde1fe (diff) | |
download | servo-ee94b3e8bf659c847bda967700272f8f98fdb0cc.tar.gz servo-ee94b3e8bf659c847bda967700272f8f98fdb0cc.zip |
auto merge of #4662 : Ms2ger/servo/overlong, r=larsbergstrom
The Rust style guide suggests 100, but we have too many violations in the
tree already. This check can be tightened over time.
Diffstat (limited to 'python')
-rw-r--r-- | python/tidy.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/python/tidy.py b/python/tidy.py index da930eea333..fc282aaa464 100644 --- a/python/tidy.py +++ b/python/tidy.py @@ -56,6 +56,13 @@ def check_license(contents): yield (1, "incorrect license") +def check_length(contents): + lines = contents.splitlines(True) + for idx, line in enumerate(lines): + if len(line) >= 160: + yield (idx + 1, "(much) overlong line") + + def check_whitespace(contents): lines = contents.splitlines(True) for idx, line in enumerate(lines): @@ -88,7 +95,7 @@ def scan(): all_files = collect_file_names(directories_to_check) files_to_check = filter(should_check, all_files) - checking_functions = [check_license, check_whitespace] + checking_functions = [check_license, check_length, check_whitespace] errors = collect_errors_for_files(files_to_check, checking_functions) errors = list(errors) |