diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-08-20 22:27:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-20 22:27:06 -0500 |
commit | 1c9650cc90090784c63f5af55628ffe6b57c25ed (patch) | |
tree | 0fd37fed9ce045149d3747a52411be9ba6b7b2b0 /python/tidy/servo_tidy_tests | |
parent | bb0ba644a8a028d6de8b5daf1b578a82ab23d49e (diff) | |
parent | 74dba5cbdd35f2564db4d489f9bed17cbc190cf6 (diff) | |
download | servo-1c9650cc90090784c63f5af55628ffe6b57c25ed.tar.gz servo-1c9650cc90090784c63f5af55628ffe6b57c25ed.zip |
Auto merge of #12877 - UK992:tidy-toml, r=Wafflespeanut
Tidy config file
This is wip workaround for https://github.com/servo/servo/issues/10841
Adds ``servo-tidy.toml`` with configs and ignored dirs, files and packages.
This will allow to set custom configuration per repo.
It's an example how could config file looks like.
I want opinion on that, if this is right approaches and how to improve it.
cc @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/12877)
<!-- Reviewable:end -->
Diffstat (limited to 'python/tidy/servo_tidy_tests')
-rw-r--r-- | python/tidy/servo_tidy_tests/servo-tidy.toml | 13 | ||||
-rw-r--r-- | python/tidy/servo_tidy_tests/test_tidy.py | 7 |
2 files changed, 20 insertions, 0 deletions
diff --git a/python/tidy/servo_tidy_tests/servo-tidy.toml b/python/tidy/servo_tidy_tests/servo-tidy.toml new file mode 100644 index 00000000000..0aea4527b99 --- /dev/null +++ b/python/tidy/servo_tidy_tests/servo-tidy.toml @@ -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 = [] diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py index bb1cb8ce61c..c8751ea59c4 100644 --- a/python/tidy/servo_tidy_tests/test_tidy.py +++ b/python/tidy/servo_tidy_tests/test_tidy.py @@ -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]) |