This fixes a regression from bug 1258341 where the eslint binary no longer
gets run from a shell on msys. Without this, a WindowsError [Error 139] is
thrown.
MozReview-Commit-ID: FQ3LhTzd8nL
--HG--
extra : rebase_source : 33490fd9e41a2691f0b0c815916185fcf8936987
This does 3 things:
1) Moves all the long descriptions for the rules into the main index.rst
document. This just makes it simpler, and there didn't seem to be much
point in having a separate document for each rule.
2) Moves index.rst to tools/lint/docs/eslint-plugin-mozilla.rst
3) Creates a new eslint.rst landing page, and includes it.
MozReview-Commit-ID: 1e3QBkMFOBe
--HG--
rename : tools/lint/eslint/eslint-plugin-mozilla/docs/index.rst => tools/lint/docs/linters/eslint-plugin-mozilla.rst
extra : rebase_source : ab2c5c89bfa77da994f20fbecffed25e9f475ce8
This integrates 'eslint' with the mozlint framework. The old |mach eslint| command is kept around
for backwards compatibility and will simply dispatch to |mach lint|. But |mach lint| should be
preferred as the old command may eventually be removed.
The old |mach eslint| command should be mostly backwards compatible with a few exceptions:
1. Can no longer define --extensions on the command line, this is instead hardcoded into
eslint.lint.
2. No longer using eslint formatters. However, the default mozlint formatter should be
identical to the default eslint formatter, so developers should not notice a change.
This does mean that non-default eslint formatters can no longer be used unless a mozlint
copy of them is created.
3. Installs dependencies automatically without prompting the user. This was necessary due to
python multiprocessing limitations, but is actually also a better UX. Because the npm
dependencies aren't global anymore, there isn't really any reason *not* to install them
automatically.
Apart from that, any difference from the old |mach eslint| I'd consider a bug.
The main eslint implementation now lives in tools/lint/eslint.lint instead of
tools/lint/mach_commands.py.
MozReview-Commit-ID: KYhC6SEySC3
--HG--
extra : rebase_source : 36d06b1a3fced764e17154cc53091d7722919b67
This change avoids lots of false positives for Coverity's CHECKED_RETURN
warning, caused by NS_WARN_IF's current use in both statement-style and
expression-style.
In the case where the code within the NS_WARN_IF has side-effects, I made the
following change.
> NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
> -->
> Unused << NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
In the case where the code within the NS_WARN_IF lacks side-effects, I made the
following change.
> NS_WARN_IF(!condWithoutSideEffects);
> -->
> NS_WARNING_ASSERTION(condWithoutSideEffects, "msg");
This has two improvements.
- The condition is not evaluated in non-debug builds.
- The sense of the condition is inverted to the familiar "this condition should
be true" sense used in assertions.
A common variation on the side-effect-free case is the following.
> nsresult rv = Fn();
> NS_WARN_IF_(NS_FAILED(rv));
> -->
> DebugOnly<nsresult rv> = Fn();
> NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Fn failed");
--HG--
extra : rebase_source : 58788245021096efa8372a9dc1d597a611d45611
Some linters, such as flake8, will lint invalid file extensions if you explicitly pass them in. E.g,
|flake8 foobar.js| will result in flake8 attempting to lint a JS file. This is a problem because passing
in files explicitly is exactly what the --rev/--workdir options do. If a developer modifies a JS file
then runs |mach lint -l flake8 -w|, that JS file will get linted.
To prevent this, mozlint needs to handle file extensions instead of relying on the underlying linter to
do it. This patch adds an "extensions" config option to the LINTER dict, and will filter these files out
as part of the 'filterpaths' steps.
MozReview-Commit-ID: KYhC6SEySC3
--HG--
extra : rebase_source : 6fea2942b2db1bea7deca1d6738546362b6ebd65
The patch is generated from following command:
rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,
MozReview-Commit-ID: AtLcWApZfES
--HG--
rename : mfbt/unused.h => mfbt/Unused.h
This fixes a bug in flake8, where if you pass in --exclude to a path with a custom .flake8 file, that
configuration will be ignored. I'm not sure why this happens.
Prior to this commit series, the 'exclude' paths weren't being passed on to the flake8 linter properly.
This is why the problems hasn't surfaced until now. This is a band-aid fix until a proper (likely
upstream) fix can be landed.
MozReview-Commit-ID: KYhC6SEySC3
--HG--
extra : rebase_source : 0dbf30dcb17c37787c2ddebbb3c7de5f3b63860b
Replace old flags in WrapForJNI usages with new flags. The calledFrom
and dispatchTo flags are set based on whether the method is native or
non-native, and how the method is used.
Also fix testEventDipatcher to respect NativeJSObject's calledFrom =
"gekco" flag, by moving a test to Gecko thread.
This patch makes the following changes on many in-class methods.
- NS_IMETHODIMP F() override; --> NS_IMETHOD F() override;
- NS_IMETHODIMP F() override {...} --> NS_IMETHOD F() override {...}
- NS_IMETHODIMP F() final; --> NS_IMETHOD F() final;
- NS_IMETHODIMP F() final {...} --> NS_IMETHOD F() final {...}
Using NS_IMETHOD is the preferred way of marking in-class virtual methods.
Although these transformations add an explicit |virtual|, they are safe --
there's an implicit |virtual| anyway because |override| and |final| only work
with virtual methods.
--HG--
extra : rebase_source : 386ee4e4ea2ecd8d5001efabc3ac87b4d6c0659f
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.
As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.
--HG--
extra : rebase_source : 815d0018b0b13329bb5698c410f500dddcc3ee12
This commit introduces the `mach rage` command. It opens a web browser
and loads a new tab with a short Google Form.
Google Forms appears to not have optional login where they capture login
info if available. So, we attempt to prepopulate the contact info
from version control or from the current login name. This field
is directly above the submit button, so it should be obvious enough
that people can clear it if they want to leave an anonymous response.
The alternative is we require a login to the Mozilla Google Apps
account. And that feels wrong.
r+ on this bug also constitutes r+ on the Google Form content.
MozReview-Commit-ID: HVAVVVva29T
--HG--
extra : rebase_source : d00aa424ffd42d8cd5d2d8a85aef8b3c24b59520
This removes the in-tree plugin from the tooltool archive and uses that code
directly from the Gecko checkout instead.
For automation, we now get ESLint and external plugins from tooltool and then
symbolic link to the in-tree plugin.
For local development, we install ESLint and external plugins following the
shrinkwrap file created from the last change to the tooltool archive. The local
plugin is then installed.
This change also removes the list of module versions from mach_commands.py, so
there is only one place to update module versions for the future.
MozReview-Commit-ID: AhbZ8lVPmN4