diff options
author | Maciej Skrzypkowski <m.skrzypkows@samsung.com> | 2016-04-13 12:18:13 +0200 |
---|---|---|
committer | askeing <askeing@gmail.com> | 2016-04-17 04:12:54 +0900 |
commit | 22d991d4e0b39dd0cb8d05215e181ac8ef957aab (patch) | |
tree | 7d35bef04486b34dd00afc5ca240808c244e00c7 /python/tidy/servo_tidy/tidy.py | |
parent | 88c94f285eca66c62678b8f847d6a4f38ea53e3c (diff) | |
download | servo-22d991d4e0b39dd0cb8d05215e181ac8ef957aab.tar.gz servo-22d991d4e0b39dd0cb8d05215e181ac8ef957aab.zip |
Test for check_spec function, for tidy.py #9152
Diffstat (limited to 'python/tidy/servo_tidy/tidy.py')
-rw-r--r-- | python/tidy/servo_tidy/tidy.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index 56c07aeae6b..206346675e2 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -69,6 +69,8 @@ ignored_dirs = [ os.path.join(".", "."), ] +spec_base_path = "components/script/dom/" + def is_iter_empty(iterator): try: @@ -525,10 +527,9 @@ def check_json(filename, contents): def check_spec(file_name, lines): - base_path = "components/script/dom/" - if base_path not in file_name: + if spec_base_path not in file_name: raise StopIteration - file_name = os.path.relpath(os.path.splitext(file_name)[0], base_path) + file_name = os.path.relpath(os.path.splitext(file_name)[0], spec_base_path) patt = re.compile("^\s*\/\/.+") # Pattern representing a line with a macro |