mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Improve tidy's license validation logic
fixes https://github.com/servo/servo/issues/10716 I took the lazy way out and hardcoded the size of block we examine for licenses. fixes https://github.com/servo/servo/issues/10719 Includes tests for new functionality.
This commit is contained in:
parent
1f4dd8765f
commit
48ace17b54
7 changed files with 73 additions and 102 deletions
|
@ -58,6 +58,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])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue