diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-08-14 09:17:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-14 09:17:34 -0500 |
commit | 8419f96dc0cb79c83922b62166390f6688f2aae0 (patch) | |
tree | 6b7bc61687291b477b4f300b6015d96d4ec864df /python/tidy/servo_tidy_tests/test_tidy.py | |
parent | 27d082e5779904a5e68e99841ae1511ff126bacd (diff) | |
parent | fed0e94ec6d4ac630fa641e32644a7e055e2e6f0 (diff) | |
download | servo-8419f96dc0cb79c83922b62166390f6688f2aae0.tar.gz servo-8419f96dc0cb79c83922b62166390f6688f2aae0.zip |
Auto merge of #12781 - UK992:tidycheck-rebased, r=Wafflespeanut
Improve tidy's license validation logic
Rebased and fixed https://github.com/servo/servo/pull/10721, which is inactive for months.
Fixes https://github.com/servo/servo/issues/10716
r? @larsbergstrom or @edunham
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12781)
<!-- Reviewable:end -->
Diffstat (limited to 'python/tidy/servo_tidy_tests/test_tidy.py')
-rw-r--r-- | python/tidy/servo_tidy_tests/test_tidy.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py index 92b304a5c1a..bb1cb8ce61c 100644 --- a/python/tidy/servo_tidy_tests/test_tidy.py +++ b/python/tidy/servo_tidy_tests/test_tidy.py @@ -48,6 +48,11 @@ class CheckTidiness(unittest.TestCase): self.assertEqual('incorrect license', errors.next()[2]) self.assertNoMoreErrors(errors) + def test_shebang_license(self): + errors = tidy.collect_errors_for_files(iterFile('shebang_license.py'), [], [tidy.check_license], print_text=False) + self.assertEqual('missing blank line after shebang', errors.next()[2]) + self.assertNoMoreErrors(errors) + def test_shell(self): errors = tidy.collect_errors_for_files(iterFile('shell_tidy.sh'), [], [tidy.check_shell], print_text=False) self.assertEqual('script does not have shebang "#!/usr/bin/env bash"', errors.next()[2]) @@ -58,6 +63,10 @@ class CheckTidiness(unittest.TestCase): self.assertEqual('script should use `[[` instead of `[` for conditional testing', errors.next()[2]) self.assertNoMoreErrors(errors) + def test_apache2_incomplete(self): + errors = tidy.collect_errors_for_files(iterFile('apache2_license.rs'), [], [tidy.check_license]) + self.assertEqual('incorrect license', errors.next()[2]) + def test_rust(self): errors = tidy.collect_errors_for_files(iterFile('rust_tidy.rs'), [], [tidy.check_rust], print_text=False) self.assertEqual('use statement spans multiple lines', errors.next()[2]) |