mirror of
https://github.com/servo/servo.git
synced 2025-07-30 18:50:36 +01:00
Auto merge of #10563 - mskrzypkows:tidy_tests, r=mbrubeck
Test for check_spec function, for tidy.py #9152 Additional test for tidy.py <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10563) <!-- Reviewable:end -->
This commit is contained in:
commit
efd6723442
3 changed files with 18 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue