Commit Graph

6 Commits

Author SHA1 Message Date
Andrew Halberstadt
3bace5cab7 Bug 1373368 - [lint] Ignore SIGINT in lint hooks, r=standard8
This defers SIGINT handling to the underlying mozlint subprocess. Mozlint *should*
return quickly and gracefully. This way the hook process itself will not abort, just
the linting. After hitting Ctrl-C, the vcs operation should continue as if the lint
were successful.

If mozlint had already found some errors before hitting Ctrl-C, those should get
printed and could potentially abort the hook.

MozReview-Commit-ID: BKXq1dXuMlB
2018-03-29 16:39:29 -04:00
Mark Banner
764abcc373 Bug 1386351 - Let the Lint hook default to pre-push (for git) if being called directly. r=glandium
MozReview-Commit-ID: 9TnLu8w92oN
2017-11-23 09:09:33 +00:00
Andrew Halberstadt
054738aa1a Bug 1405588 - [lint] Stop forwarding 'args' in the git pre-push hook, r=standard8
The args passed in from the git pre-push hook aren't necessarily a valid ref,
so can result in failure. By default, the git implementation should be smart
enough to automatically determine which ref to compare against, so passing this
in from the hook shouldn't be necessary.

MozReview-Commit-ID: ESMQqbeGOHd
2017-11-01 17:07:18 -04:00
Andrew Halberstadt
c92ebdb6aa Bug 1382140 - Call 'mach' with python from tools/lint/hooks.py so it works on Windows, r=mak
MozReview-Commit-ID: 7Iac4wqX9RG
2017-07-24 12:25:53 -04:00
Andrew Halberstadt
581029575e Bug 1380135 - Use --quiet to ignore eslint warnings from the vcs hook; add +x to hooks.py, r=standard8
The eslint task ignores warnings, therefore the vcs hook should as well. The --quiet argument will
be ignored by other linters.

This also makes tools/lint/hooks.py executable which was preventing it from being used on git.

MozReview-Commit-ID: DXbx01shJmX
2017-07-11 17:02:46 -04:00
Andrew Halberstadt
408093ed28 Bug 1361972 - Add a pre-push and pre-commit mozlint hooks r=standard8
This adds pre-push and pre-commit hooks for both hg and git. All
four possibilities are implemented in the same file.

To enable a pre-push hg hook, add the following to hgrc:

    [hooks]
    pre-push.lint = python:/path/to/gecko/tools/lint/hooks.py:hg


To enable a pre-commit hg hook, add the following to hgrc:

    [hooks]
    pretxncommit.lint = python:/path/to/gecko/tools/lint/hooks.py:hg


To enable a pre-push git hook, run the following command:

    $ ln -s /path/to/gecko/tools/lint/hooks.py .git/hooks/pre-push


To enable a pre-commit git hook, run the following command:

    $ ln -s /path/to/gecko/tools/lint/hooks.py .git/hooks/pre-commit


MozReview-Commit-ID: DUxCKN2fiag
2017-06-30 18:29:42 -07:00