mirror of
https://github.com/servo/servo.git
synced 2025-07-30 10:40:27 +01:00
Tidy: Prefer monkey patching sys.path over addsitedir (and some cleanup)
This commit is contained in:
parent
103e827948
commit
841a3abef6
2 changed files with 24 additions and 21 deletions
|
@ -8,7 +8,7 @@
|
|||
# except according to those terms.
|
||||
|
||||
import os
|
||||
import site
|
||||
import sys
|
||||
|
||||
from servo_tidy.tidy import LintRunner, filter_file
|
||||
|
||||
|
@ -28,11 +28,13 @@ class Lint(LintRunner):
|
|||
def run(self):
|
||||
if self.stylo:
|
||||
return
|
||||
|
||||
wpt_working_dir = os.path.abspath(os.path.join(WPT_PATH, "web-platform-tests"))
|
||||
for suite in SUITES:
|
||||
files = self._get_wpt_files(suite)
|
||||
site.addsitedir(wpt_working_dir)
|
||||
sys.path.insert(0, wpt_working_dir)
|
||||
from tools.lint import lint
|
||||
sys.path.remove(wpt_working_dir)
|
||||
file_dir = os.path.abspath(os.path.join(WPT_PATH, suite))
|
||||
returncode = lint.lint(file_dir, files, output_json=False, css_mode=False)
|
||||
if returncode:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue