mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Check for errors in tidy config file
This commit is contained in:
parent
0ad905ae42
commit
74dba5cbdd
3 changed files with 69 additions and 1 deletions
13
python/tidy/servo_tidy_tests/servo-tidy.toml
Normal file
13
python/tidy/servo_tidy_tests/servo-tidy.toml
Normal file
|
@ -0,0 +1,13 @@
|
|||
key-outside = ""
|
||||
|
||||
[configs]
|
||||
skip-check-length = false
|
||||
skip-check-licenses = false
|
||||
wrong-key = false
|
||||
|
||||
[wrong]
|
||||
wrong-key = true
|
||||
|
||||
[ignore]
|
||||
files = []
|
||||
directories = []
|
|
@ -23,6 +23,13 @@ class CheckTidiness(unittest.TestCase):
|
|||
with self.assertRaises(StopIteration):
|
||||
errors.next()
|
||||
|
||||
def test_tidy_config(self):
|
||||
errors = tidy.check_config_file(os.path.join(base_path, 'servo-tidy.toml'))
|
||||
self.assertEqual('invalid config key \'key-outside\'', errors.next()[2])
|
||||
self.assertEqual('invalid config key \'wrong-key\'', errors.next()[2])
|
||||
self.assertEqual('invalid config table [wrong]', errors.next()[2])
|
||||
self.assertNoMoreErrors(errors)
|
||||
|
||||
def test_spaces_correctnes(self):
|
||||
errors = tidy.collect_errors_for_files(iterFile('wrong_space.rs'), [], [tidy.check_by_line], print_text=False)
|
||||
self.assertEqual('trailing whitespace', errors.next()[2])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue