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
This removes the unnecessary setting of c-basic-offset from all
python-mode files.
This was automatically generated using
perl -pi -e 's/; *c-basic-offset: *[0-9]+//'
... on the affected files.
The bulk of these files are moz.build files but there a few others as
well.
MozReview-Commit-ID: 2pPf3DEiZqx
--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
The file base/content/browser-fullScreen.js was renamed. This patch updates the reference
to this filename in the esling rule import-browserjs-globals.js and bumps the version to
0.1.1.
MozReview-Commit-ID: 9hibfDnbtp
Because bug 1282866 removed Qt support but missed a bunch of things.
* * *
Bug 1285554 - more
--HG--
extra : rebase_source : c48d2485f1fdf1c961e08d91651bbca41e3a1a53
This adds two parameters, --rev and --workdir. Each works both with mercurial and git (though the syntax for
specifying revisions is different between them). The value is simply forwarded to either |hg log| or |git diff|
so syntax like |mach lint -r .~4::.| or |mach lint -r "HEAD~4 HEAD"| will work as expected.
MozReview-Commit-ID: aOGp2Yrncs
--HG--
extra : rebase_source : d2cb834d4cc1a083171a3551af4e72c8a7d14021
There is currently no built-in user interface to mozlint. The only existing interface is the
external cli provided by |mach lint|. However, in the future mozlint may need to be used in a
context where mach isn't readily available (i.e version-control-tools). This patch basically
just moves the cli logic out of mach_commands.py, and into mozlint core. That way it can be
re-used in other places without needing to be re-implemented.
The |mach lint setup| subcommand was removed because apparently subcommands don't work with
the parser attribute. Nothing was using it yet anyway, so I removed it for now. It may get
re-added in some form in the future.
MozReview-Commit-ID: aOGp2Yrncs
--HG--
extra : rebase_source : 8f7530de96e5c131d2ed5bfcdd7a159329401e5b
The profiler's signal handler clobbers errno, via its calls to sem_post,
or via other functions that it transitively calls. TSan complains about
this, as a sample arriving at the wrong time could make it look like a
function that failed actually succeeded, or vice versa. Ensure that the
signal handler preserves the state of the world by saving and restoring
errno around its operation.
This patch unifies the include search directories for the breakpad
on B2G and Android, and protects breakpad-internal workarounds against
multiple definition.
As a side-effect of the patch set, no more Gonk-specific headers from
'gonk-include' are requried to build toolkit/ or xpcom/. The related
artifacts are removed by this patch.
MozReview-Commit-ID: E94I2rspDtJ
This patch unifies the include search directories for the breakpad
on B2G and Android, and protects breakpad-internal workarounds against
multiple definition.
As a side-effect of the patch set, no more Gonk-specific headers from
'gonk-include' are requried to build toolkit/ or xpcom/. The related
artifacts are removed by this patch.
MozReview-Commit-ID: E94I2rspDtJ
This makes it easier to lint a path that otherwise wouldn't have been linted due to the include/exclude
directives. Now, you can pass in -n/--no-filter instead of needing to modify the linter configuration file.
MozReview-Commit-ID: GMJuE2C1NyY
--HG--
extra : rebase_source : 03627e930f76903ad629cb01b58c4ae7372e4bb1
These locations have changed since the end of Google Code.
MozReview-Commit-ID: FSGhFBDaTCq
--HG--
extra : rebase_source : 4ef004b2d0b8f1a6331db0f44ccf70d05ad62774
The wizard has been ported to the version-control-tools repository
and in-tree consumers have been switched to consume it from there. This
code is now dead. Kill it.
References to the now-defunct code have been removed/updated.
MozReview-Commit-ID: 5fpCXdNIp8L
--HG--
extra : rebase_source : 6c1e2363793fe2cd3a506ce5d962788657871203
extra : histedit_source : c40d2203aaa54bbd48e4e2b46178e277dcdc2e3f
This begins the consolidation of `mach mercurial-setup` into
`mach bootstrap`. The first step is to move the content of the
mach_commands.py file into the bootstrapper's.
I'm not crazy about adding the sys.path entry for tools/mercurial.
I intend to clean this up later.
MozReview-Commit-ID: Cq56wPG8sO1
--HG--
extra : rebase_source : 48d6d2631760c9333bf99285673430948085630e
extra : histedit_source : e062f6fbc0ae9678347801b4a1f1c9b6912afd52
I never really liked this. Other people had even more visceral
reactions. Let's get rid of it.
The code for touching a file when it runs has also been removed because
the only thing it was used for was the nagging feature.
MozReview-Commit-ID: ERUVkEYgkzx
--HG--
extra : rebase_source : 1c1ed9c00eb2164d19e4405f2b8becf59680d1ed
extra : histedit_source : 9f2ebc64443140c0bc853ee5a3418f4e0f03db7b
This is a crude workaround to get subdirectory .flake8 files working. Hopefully
this is temporary until flake8 3.0 is released with support for multiple config
files.
Note that .flake8 files that live outside of a directory that is explicitly
listed in the 'include' directive, will not be considered.
MozReview-Commit-ID: GtpUZHJKq52
--HG--
extra : rebase_source : 0294e135673a3b580316a46ec13e37749422edba
Enables flake8 linting! To start, only these directories are actually linted:
- python/mozlint
- tools/lint
To enable new directories, add them to the 'include' directive at the bottom of:
tools/lint/flake8.lint
Edit topsrcdir/.flake8 to modify global configuration. Add a new .flake8 to a
subdirectory to override the global. The current configuration is more or less
just the default and we should tweak it to our needs.
MozReview-Commit-ID: iXbToRhm3b
--HG--
extra : transplant_source : %E7i%04%07%1C%B3%E4%FD%FF%BB%A6w%CF%27t%FFz%CD%5EE
This is a really simple and ugly formatter that is compatible with
treeherder's error highlighting mechanism. It is designed to be identical
to the current eslint output on treeherder:
https://dxr.mozilla.org/mozilla-central/rev/4d63dde701b47b8661ab7990f197b6b60e543839/tools/lint/eslint-formatter.js
Eventually eslint will also use this and we can remove that file. Once
bug 1276486 is fixed, we can make this look a little nicer. But for now
it gets the job done.
MozReview-Commit-ID: CwfWPcwWFxF
--HG--
extra : transplant_source : %F3PJ%CB%27%A5%82U%D2%CF%B3%9E%A7%9F%0F%A4%F4%E9%5D%BB
The hgwatchman project has been renamed to fsmonitor and has been moved
into Mercurial core, as of version 3.8.
Accordingly, for Mercurial >= 3.8, we shall skip installing hgwatchman
but just set fsmonitor in hgrc file instead.
DONTBUILD (NPOTB)
MozReview-Commit-ID: 426rla5riCM
--HG--
extra : rebase_source : 359eb135a2c16361125da6f1fe97eedf9434032e
Enables flake8 linting! To start, only these directories are actually linted:
- python/mozlint
- tools/lint
To enable new directories, add them to the 'include' directive at the bottom of:
tools/lint/flake8.lint
Edit topsrcdir/.flake8 to modify global configuration. Add a new .flake8 to a
subdirectory to override the global. The current configuration is more or less
just the default and we should tweak it to our needs.
MozReview-Commit-ID: iXbToRhm3b
--HG--
extra : rebase_source : 78c4491261ba36421110b0d9fca73c1f6d1f85c3
This is a really simple and ugly formatter that is compatible with
treeherder's error highlighting mechanism. It is designed to be identical
to the current eslint output on treeherder:
https://dxr.mozilla.org/mozilla-central/rev/4d63dde701b47b8661ab7990f197b6b60e543839/tools/lint/eslint-formatter.js
Eventually eslint will also use this and we can remove that file. Once
bug 1276486 is fixed, we can make this look a little nicer. But for now
it gets the job done.
MozReview-Commit-ID: CwfWPcwWFxF
--HG--
extra : rebase_source : 8dd39aefec1064e0836c847c6d223db43df4755b
Our policy is to support the last 4 releases of Mercurial. 3.8 is out.
So we bump the minimum version to 3.5.
MozReview-Commit-ID: 9cftV7CscRL
--HG--
extra : rebase_source : c1875946afc0b8a586d3ec474adece7321812be7
extra : amend_source : 0fa318cd26de3dc0b73033713818f371e43ddd9c
These variables specify a version of Mercurial that is considered
modern and won't trigger giant warnings about being out of date.
We bump to 3.7.3 because 3.7.3 contains security fixes and it is
important for as many users as possible to get these security fixes.
We also update the messaging to indicate security issues with older
releases.
MozReview-Commit-ID: H4utKINrW0V
--HG--
extra : rebase_source : 5247fec94d7df351ef3c7bb2aa60396bb19a6196
extra : amend_source : 70b9aa52cde71d11e2b6d65a1a83567b8a0c7965
MQ isn't recommended for modern Mercurial development. Stop advertising
it.
MozReview-Commit-ID: IOx3A5ZeJnJ
--HG--
extra : rebase_source : a6b49ebdba3fbdb0b0bab13fd59aae3fcdcf167c
This makes the child process write its memory map to a different file
name, just like it does for the jprof log. It tries to share the
variables between the two so that they're both connected in the code and
consistent with each other.
Note that I haven't yet written the patch to make jprof.cpp *read* the
map from that file, so this currently requires manually renaming the
generated map with the numeric suffix to jprof-map in order to run
jprof. I should probably write that patch eventually, but I haven't
actually needed to.
This at least prevents the child process's map file from being
overwritten by the parent's a fraction of a second later.
MozReview-Commit-ID: 7L4wT9BdQYI