mirror of
https://github.com/servo/servo.git
synced 2025-07-03 05:23:38 +01:00
Add ./mach test-tidy --no-wpt
, for a git pre-push hook
Disabling WPT manifest checking brings the time it takes to run tidy for ~11 seconds to ~3 seconds, which feels reasonable to have in a git pre-push hook. This can help avoid forgetting to run tidy before opening a PR. ``` $ chmod +x .git/hooks/pre-push $ cat .git/hooks/pre-push #!/bin/sh set -e ./mach test-tidy --no-wpt ```
This commit is contained in:
parent
dc8be8f282
commit
c8a49baa80
1 changed files with 7 additions and 2 deletions
|
@ -315,15 +315,20 @@ class MachCommands(CommandBase):
|
||||||
@CommandArgument('--all', default=False, action="store_true", dest="all_files",
|
@CommandArgument('--all', default=False, action="store_true", dest="all_files",
|
||||||
help="Check all files, and run the WPT lint in tidy, "
|
help="Check all files, and run the WPT lint in tidy, "
|
||||||
"even if unchanged")
|
"even if unchanged")
|
||||||
|
@CommandArgument('--no-wpt', default=False, action="store_true", dest="no_wpt",
|
||||||
|
help="Skip checking that web-platform-tests manifests are up to date")
|
||||||
@CommandArgument('--no-progress', default=False, action="store_true",
|
@CommandArgument('--no-progress', default=False, action="store_true",
|
||||||
help="Don't show progress for tidy")
|
help="Don't show progress for tidy")
|
||||||
@CommandArgument('--self-test', default=False, action="store_true",
|
@CommandArgument('--self-test', default=False, action="store_true",
|
||||||
help="Run unit tests for tidy")
|
help="Run unit tests for tidy")
|
||||||
@CommandArgument('--stylo', default=False, action="store_true",
|
@CommandArgument('--stylo', default=False, action="store_true",
|
||||||
help="Only handle files in the stylo tree")
|
help="Only handle files in the stylo tree")
|
||||||
def test_tidy(self, all_files, no_progress, self_test, stylo):
|
def test_tidy(self, all_files, no_wpt, no_progress, self_test, stylo):
|
||||||
if self_test:
|
if self_test:
|
||||||
return test_tidy.do_tests()
|
return test_tidy.do_tests()
|
||||||
|
else:
|
||||||
|
if no_wpt:
|
||||||
|
manifest_dirty = False
|
||||||
else:
|
else:
|
||||||
manifest_dirty = run_update(self.context.topdir, check_clean=True)
|
manifest_dirty = run_update(self.context.topdir, check_clean=True)
|
||||||
tidy_failed = tidy.scan(not all_files, not no_progress, stylo=stylo)
|
tidy_failed = tidy.scan(not all_files, not no_progress, stylo=stylo)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue