servo: Merge #10786 - tidy check for vim and emacs modelines (from zwn:tidy-modelines); r=Manishearth
See #10719. It skips *.webidl files for now since I am not sure where they come from and if they should be edited in tree or not. Source-Repo: https://github.com/servo/servo Source-Revision: 04f8ae56db0ba9df798b39a5b2f1bb1e23d6dcf3
This commit is contained in:
5
servo/python/tidy/servo_tidy_tests/modeline.txt
Normal file
5
servo/python/tidy/servo_tidy_tests/modeline.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
# vim: set noexpandtab:
|
||||
// vi: et:
|
||||
/* ex: et:
|
||||
anything -*-Lisp-*-
|
||||
-*- mode: Lisp -*-
|
||||
@@ -89,6 +89,14 @@ class CheckTidiness(unittest.TestCase):
|
||||
self.assertEqual('found asterisk instead of minimum version number', errors.next()[2])
|
||||
self.assertNoMoreErrors(errors)
|
||||
|
||||
def test_modeline(self):
|
||||
errors = tidy.collect_errors_for_files(iterFile('modeline.txt'), [], [tidy.check_modeline])
|
||||
self.assertEqual('vi modeline present', errors.next()[2])
|
||||
self.assertEqual('vi modeline present', errors.next()[2])
|
||||
self.assertEqual('vi modeline present', errors.next()[2])
|
||||
self.assertEqual('emacs file variables present', errors.next()[2])
|
||||
self.assertEqual('emacs file variables present', errors.next()[2])
|
||||
|
||||
|
||||
def do_tests():
|
||||
suite = unittest.TestLoader().loadTestsFromTestCase(CheckTidiness)
|
||||
|
||||
Reference in New Issue
Block a user