This makes the --config-path option relative to topsrcdir rather then the current
directory.
Using a relative path is difficult for a developer running mach lint locally as
the command has to change as the working directory changes. A stable base path also
facilitates creating an alias in machrc.
Differential Revision: https://phabricator.services.mozilla.com/D68909
--HG--
extra : moz-landing-system : lando
In the process, fixed a few bugs:
- the template eg `{file_adds % "\n{file}"}` produced a leading blank line,
which led to everything being linted.
- 'd' was replaced with 'r' in diff_filters, but the replacement was discarded.
- as a result of the above, `hg status -d` was being used ("show only deleted (but tracked) files") and now it is `hg status -r` ("show only removed files"). I *think* this is what was intended?
Differential Revision: https://phabricator.services.mozilla.com/D66714
--HG--
extra : moz-landing-system : lando
Adds --config-paths parameter to mach mozlint where test configuration
files (.yml) can be located. The default path "tools/lint" is set automatically
and additional paths have preference over the default.
This allows Thunderbird to run mozlint-based tests in Taskcluster with a
different configuration.
Differential Revision: https://phabricator.services.mozilla.com/D67077
--HG--
extra : moz-landing-system : lando
While we validate user specified paths early and only consider the 'AM' (added
+ modified) diff filter from versioncontrol, it's still possible to get
non-existent files when using --outgoing. This situation can happen when you
have a commit series that first modifies a file in an earlier commit, and then
moves/deletes it in a later commit.
To get around this, just silently filter out any file paths that don't exist.
Differential Revision: https://phabricator.services.mozilla.com/D67411
--HG--
extra : moz-landing-system : lando
Major version number bump for both mozlog and mozcrash + requirements update.
This is very much like the previous mozlog major bump - see bug 1591384.
This patch does not update testing/web-platform/tests/tools/wptrunner/requirements.txt;
I expect that will be automatically updated by the pyup.io bot once mozlog is re-released.
Differential Revision: https://phabricator.services.mozilla.com/D65135
--HG--
extra : moz-landing-system : lando
Essentially:
FilterPath("docs").contains("docshell")
was returning True because "docshell" startswith "docs".
Differential Revision: https://phabricator.services.mozilla.com/D64661
--HG--
extra : moz-landing-system : lando
This is a ride-along commit that would have made debugging the problem solved
by this bug easier.
Depends on D60688
Differential Revision: https://phabricator.services.mozilla.com/D60689
--HG--
extra : moz-landing-system : lando
This was happening because we had two exclude paths that were run through the 'collapse' algorithm:
editor/libeditor/tests/browserscope/lib/richtext
editor/libeditor/tests/browserscope/lib/richtext2
The problem was that in order to determine the base directory, the algorithm called
'os.path.commonprefix'. This function just returns the common string prefix, which
is the '.../lib/richtext' path. Even though in the above, the base *should* have
been '.../lib'.
To fix the problem, we add a check to ensure the computed base doesn't have any
sibling directories with the same prefix. If there are, it means 'commonprefix' was
too greedy.
Differential Revision: https://phabricator.services.mozilla.com/D60173
--HG--
extra : moz-landing-system : lando
This is needed to release a new mozlog with the PRECONDITION_FAILED
test and subtest status for use in web-platform-tests.
Update all in-tree dependencies on mozlog to >=5.0. These were found
with `hg grep 'mozlog.*[0-9]'`.
Only testing/web-platform/tests/tools/wptrunner/requirements.txt
remains on 4.2.0, and it will be updated in upstream wpt after mozlog
5.0 has been released.
Differential Revision: https://phabricator.services.mozilla.com/D50456
--HG--
extra : moz-landing-system : lando
This patch adds a global lint that only runs when a file or directory
that matches their configuration (via `extensions` and `exclude`) has
been modified or specified.
Global lints never shard into chunks; they are, by definition global
(i.e., across the entire source tree) and act on all inputs in a
single invocation. It's up to the global lint to manage command line
sizes, etc. Since batching is handled by the lint type but sharding
is handled by the lint roller, there's a little abstraction leak so
that the lint type can control how its invocation is sharded: the
existing `batch` member is generalized from the existing `True` and
`False` to add a new `"global"` value which disables sharding.
Differential Revision: https://phabricator.services.mozilla.com/D35275
--HG--
extra : moz-landing-system : lando
This allows lints to "condition" themselves on having a build
environment or a specific build application. It also adds the "name"
parameter, so that setup functions can be shared across lints.
`MozbuildObject` cannot be used as parameters to functions distributed
via multiprocessing, since they cannot be pickled (due, currently, to
internal terminal handles). Therefore we extract just a few key
parts of the environment to expose.
Differential Revision: https://phabricator.services.mozilla.com/D35274
--HG--
extra : moz-landing-system : lando
Flake8 ignores the 'exclude' section of the .flake8.yml if you pass in a direct
path to a file. To get around this we have some custom logic to handle these
exclusions for us, but this custom logic didn't account for globs.
Differential Revision: https://phabricator.services.mozilla.com/D23145
--HG--
extra : moz-landing-system : lando
The motivations for this are:
1) Apply global excludes. This merges the exclusion rules defined in
tools/lint/mach_commands.py with the ones in .flake8.
2) Improve performance. Switching to a blacklist will result in a much longer
runtime for linting the entire tree and flake8 handles exclusions incredibly
slowly. Without this patch (and the blacklist change applied), I gave up
waiting after 30 minutes. With this patch, it takes 30 seconds.
Depends on D20495
Differential Revision: https://phabricator.services.mozilla.com/D20496
--HG--
rename : tools/lint/test/files/flake8/bad.py => tools/lint/test/files/flake8/subdir/exclude/bad.py
extra : moz-landing-system : lando
This will be re-used by the flake8 linter, so moving it into mozlint for
re-useability.
Depends on D20493
Differential Revision: https://phabricator.services.mozilla.com/D20494
--HG--
extra : moz-landing-system : lando
The following python-test paths are being moved out of 'make check' and into their own task:
- python/mozlint
- testing/mozbase
- tools/lint
The following python-test paths previously did not run on Windows:
- python/mozterm
- testing/marionette
- testing/raptor
- tools/tryselect
Differential Revision: https://phabricator.services.mozilla.com/D10759
--HG--
extra : moz-landing-system : lando
The following python-test paths are being moved out of 'make check' and into their own task:
- python/mozlint
- testing/mozbase
- tools/lint
The following python-test paths previously did not run on Windows:
- python/mozterm
- testing/marionette
- testing/raptor
- tools/tryselect
MozReview-Commit-ID: C07FANaYzf7
Depends on D10758
Differential Revision: https://phabricator.services.mozilla.com/D10759
--HG--
extra : moz-landing-system : lando
This assumes that a lineno of 0 denotes a "file-level" issue, e.g an issue
associated with the filename. In the future it might be better to treat these
"file-level" issues as first class citizens. This would involve updating things
like formatters, editor integrations and review bot to not assume a lineno.
Differential Revision: https://phabricator.services.mozilla.com/D10383
--HG--
extra : moz-landing-system : lando
We were currently adding exclude paths to the "discard" set if the path contains
the include, but we weren't adding them if the include contains the path.
Depends on D5863
Differential Revision: https://phabricator.services.mozilla.com/D8845
--HG--
extra : moz-landing-system : lando
Right now there are excludes defined in the linter definition (via the .yml
files), as well as excludes defined in lintargs (via the mach_commands.py).
This is a minor simplification that extends each linter definition's local
excludes with the global ones right off the bat. This just makes it a bit
easier to keep track of.
Depends on D5863
Differential Revision: https://phabricator.services.mozilla.com/D8844
--HG--
extra : moz-landing-system : lando