aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy/servo_tidy_tests/test_tidy.py
diff options
context:
space:
mode:
authorvwvww <memory128m@gmail.com>2017-02-05 15:49:01 +0900
committervwvww <memory128m@gmail.com>2017-02-23 01:29:46 +0900
commitccb14abd12ff643b5bc140613f2fc13935cdf579 (patch)
treefc1e0f9909f1b40004a45664a213b62df8404138 /python/tidy/servo_tidy_tests/test_tidy.py
parent469ed934e75f1e231ffd005e7b3cb058fcca307f (diff)
downloadservo-ccb14abd12ff643b5bc140613f2fc13935cdf579.tar.gz
servo-ccb14abd12ff643b5bc140613f2fc13935cdf579.zip
Add 'use statements with extraneous spaces' tidy check
Add 'use statements with extraneous spaces' tidy check I added simple check routine for 'use statements with extraneous spaces' and codes that breaks the check routine in rust_tidy.rs. * Added a code that using 'use statements with extraneous spaces' code in rust_tidy.rs * Added assertion code in test_tidy.py. * check_rust function in tidy.py now recognizes the simple case in the 'use statements with extraneous spaces'. * Ran tidy check on rust code and modified a code(tests/unit/style/parsing/inherited_text.rs) that is not passing on this new tidy check. TODO: this code has to be refactored to support more general cases. - [X] ./mach test-tidy does not report any errors - [X] These changes fix #14898 (github issue number if applicable).
Diffstat (limited to 'python/tidy/servo_tidy_tests/test_tidy.py')
-rw-r--r--python/tidy/servo_tidy_tests/test_tidy.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py
index f9ccf889ec0..91f1c54ab55 100644
--- a/python/tidy/servo_tidy_tests/test_tidy.py
+++ b/python/tidy/servo_tidy_tests/test_tidy.py
@@ -95,6 +95,8 @@ class CheckTidiness(unittest.TestCase):
def test_rust(self):
errors = tidy.collect_errors_for_files(iterFile('rust_tidy.rs'), [], [tidy.check_rust], print_text=False)
+ self.assertEqual('extra space after {', errors.next()[2])
+ self.assertEqual('extra space before }', errors.next()[2])
self.assertEqual('use statement spans multiple lines', errors.next()[2])
self.assertEqual('missing space before }', errors.next()[2])
self.assertTrue('use statement is not in alphabetical order' in errors.next()[2])