Fix bugs in mach test-tidy (#31232)

* mach: test-tidy should return 1 for failure

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* fix lint issues

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* mach: tidy should allow spec links with trailing text

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Mukilan Thiyagarajan 2024-01-31 11:20:36 +05:30 committed by GitHub
parent b2f73723f8
commit 04a9b8ca39
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 6 deletions

View file

@ -473,7 +473,7 @@ mod gen {
enabled: bool,
},
testing: {
/// Enable a non-standard event handler for verifying behavior of media elements during tests.
/// Enable a non-standard event handler for verifying behavior of media elements during tests.
enabled: bool,
}
},

View file

@ -10,9 +10,7 @@
import os
import shutil
import subprocess
from typing import Dict, Optional
from .. import util
from typing import Optional
class Base:

View file

@ -218,7 +218,7 @@ class MachCommands(CommandBase):
else:
print("\r ✅ test-tidy reported no errors.")
tidy_failed
return tidy_failed
@Command('test-scripts',
description='Run tests for all build and support scripts.',

View file

@ -822,7 +822,7 @@ def check_spec(file_name, lines):
macro_patt = re.compile(r"^\s*\S+!(.*)$")
# Pattern representing a line with comment containing a spec link
link_patt = re.compile(r"^\s*///? (<https://.+>|https://.+)$")
link_patt = re.compile(r"^\s*///? (<https://.+>.*|https://.+)$")
# Pattern representing a line with comment or attribute
comment_patt = re.compile(r"^\s*(///?.+|#\[.+\])$")