Commit graph

59 commits

Author SHA1 Message Date
Mark Banner
67e9352298 Bug 1766238 - Disallow more than one argument to ChromeUtils.import via ESLint. r=mossop
Depends on D144562

Differential Revision: https://phabricator.services.mozilla.com/D144563
2022-04-27 08:38:35 +00:00
Barret Rennie
c34d04e40e Bug 1765675 - Reject OS.Path usage in reject-osfile lint r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D144307
2022-04-26 17:34:35 +00:00
Kagami Sascha Rosylight
7f736cdebf Bug 1703953 - Part 1: Implement mozilla/use-isinstance rule r=Gijs,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D111354
2022-04-06 11:57:56 +00:00
Mark Banner
a6d11f320d Bug 1760286 - Add missing docs for rules in eslint-plugin-mozilla. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D142285
2022-03-30 17:40:15 +00:00
Gijs Kruitbosch
4d3b6146b8 Bug 1753696 - use an eslint rule to switch to add_setup(), r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D139542
2022-03-30 16:16:42 +00:00
Norisz Fay
acdd6851cd Backed out 2 changesets (bug 1753696) for causing multiple dt and bc failures CLOSED TREE
Backed out changeset 67fd9edfbcea (bug 1753696)
Backed out changeset a9d957ea887b (bug 1753696)
2022-03-30 12:17:55 +03:00
Gijs Kruitbosch
35d2a4ca12 Bug 1753696 - use an eslint rule to switch to add_setup(), r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D139542
2022-03-30 08:18:51 +00:00
criss
4eec7e25a3 Backed out 3 changesets (bug 1703953) for causing multiple failures. CLOSED TREE
Backed out changeset 871a1fac289e (bug 1703953)
Backed out changeset 8151244bda18 (bug 1703953)
Backed out changeset eaf6d4c353be (bug 1703953)
2022-03-29 17:01:58 +03:00
Kagami Sascha Rosylight
cbfca993e7 Bug 1703953 - Part 1: Implement mozilla/use-isinstance rule r=Gijs,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D111354
2022-03-29 13:10:59 +00:00
Mark Banner
8bb4667fae Bug 1758474 - Implement an ESLint rule to disallow passing {} as the target parameter for ChromeUtils.import. r=Gijs,mossop,perftest-reviewers,preferences-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D140517
2022-03-11 16:41:29 +00:00
smolnar
e89faa903f Backed out changeset 5018856d8fee (bug 1758474) for causing node eslint failure. CLOSED TREE 2022-03-10 11:58:45 +02:00
Mark Banner
fe937b78bd Bug 1758474 - Implement an ESLint rule to disallow passing {} as the target parameter for ChromeUtils.import. r=Gijs,mossop,perftest-reviewers,preferences-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D140517
2022-03-10 09:25:28 +00:00
Mitchell Hentges
1d06e45585 Bug 1756224: Update references to perfdocs linter to explicitly set path r=sparky
Ideally, the `perfdocs` linter suggestion to `--fix` issues would take
into account the `paths` that were provided, rather than printing the
sure-fire "lint and fix all" solution.

Actually, on further consideration, theoretically such a recommendation
should appear at the `./mach lint` level, and not be linter-specific. Oh
well, that's a future improvement :)

-----

This patch updates the `perfdocs` documentation and suggestions to
successfully operate in the same manner that they did before
bug 1753701.

Differential Revision: https://phabricator.services.mozilla.com/D139159
2022-03-09 15:52:49 +00:00
Chris Peterson
4c1f824528 Bug 1756504 - Remove cpp-virtual-final linter, a minor style check that doesn't diagnose real bugs. r=firefox-static-analysis-reviewers,sylvestre
In bug 1436263, I added a cpp-virtual-final.yml linter to warn about virtual function declarations that included more than one virtual function specifier `virtual`, `final`, or `override`.

I think we should remove this linter now because:

* It's just a style check and doesn't diagnose a real bug. Including more than one virtual function specifier (`virtual`, `final`, or `override`) is harmless and unambiguous, just unnecessary extra code.
* It has caused some engineer frustration because this style check caused their changeset to be backed out of autoland. Backing out and fixing these style issues are not a good use of sheriffs' or engineers' time.
* It doesn't catch all virtual/final/override style issues because:
  * It can't analyze virtual function definitions that span multiple lines.
  * It doesn't check for `virtual void Foo() override` because  there are over 6000 cases already, so our code will never follow this style check consistently.

Differential Revision: https://phabricator.services.mozilla.com/D139454
2022-02-24 02:14:39 +00:00
Sylvestre Ledru
caaedeee98 Bug 1753413 - fx doc: Remove whitespaces, trailing lines & windows CR r=andi,perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D137741
2022-02-03 18:34:58 +00:00
Sylvestre Ledru
1e47dd5d4f Bug 1738988 - Add support for trojan source detection in mozlint r=linter-reviewers,ahal DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D131086
2021-11-19 08:37:28 +00:00
OnuohaOluebube
5ff974a055 Bug 1460100 - Added ESLint rule to prevent use of nsIScriptableUnicodeConverter r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D129668
2021-11-01 16:56:25 +00:00
Nihanth Subramanya
e6d5cae88b Bug 1731780 - Reject .only() chained onto add_task in tests. r=Gijs,mythmon,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D128027
2021-10-13 21:26:40 +00:00
Agi Sferro
2bd64785fc Bug 1571899 - Use google-java-format via spotless to enforce Java formatting. r=ahal,owlish
This change adds a new lint `android-format` which enforces formatting of Java
code using google-java-format.

To run the lint simply run:

./mach lint -l android-format

This command also support automatically fixing all errors running by adding
--fix:

./mach lint -l android-format --fix

This change also removes all the formatting-related checkstyle checks which are
now implicitly enforced by the formatter.

Differential Revision: https://phabricator.services.mozilla.com/D127734
2021-10-11 18:11:55 +00:00
Michael Comella
be77ae1fd6 Bug 1729053 - add links to Engineering Show and Tell. r=jaws,firefox-source-docs-reviewers,sylvestre
I feel these productivity tips will remain helpful in the future and
having them in our documentation will make them more discoverable.

Differential Revision: https://phabricator.services.mozilla.com/D124477
2021-09-08 19:45:05 +00:00
Gijs Kruitbosch
6fce85b1ba Bug 1708462 - add warning level linter for OS.File use, r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D120684
2021-07-28 15:15:03 +00:00
Mark Banner
ff109894f5 Bug 1587022 - Improve documentation for remaining Mozilla specific ESLint rules. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D118735
2021-07-05 11:38:39 +00:00
Mitchell Hentges
e568fa2e0d Bug 1714641: Remove usages of vendored "backports" code r=ahal,perftest-reviewers
It provides `shutil.which(...)`, which has been part of `shutil` since
Python 3.3.

Differential Revision: https://phabricator.services.mozilla.com/D117063
2021-06-09 15:48:52 +00:00
Sylvestre Ledru
24951f13b0 Bug 1702922 - mozlint/ride along: Document how to run a specific testsuite r=linter-reviewers,marco DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D113287
2021-04-26 08:13:04 +00:00
Akshat
410a4c846a Bug 1692974 - doc(mozlint): Add documentation for counting fixed issues r=sylvestre DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D105271
2021-02-17 08:49:12 +00:00
Mark Banner
67bf517e00 Bug 1608272 - Extend an ESLint rule to disallow 'this' as the second argument to ChromeUtils.import. r=Gijs
Depends on D104684

Differential Revision: https://phabricator.services.mozilla.com/D104685
2021-02-11 22:02:16 +00:00
Dan Minor
febbe04140 Bug 1416149 - Add linter for checking fluent files r=zbraniecki,gregtatum,flod,Gijs,fluent-reviewers,linter-reviewers,sylvestre
This adds a linter for Fluent files based upon the existing test for bad
strings in browser_misused_characters_in_strings.js. It also adds a check
for identifiers that only permits lowercase letters, numbers and the
hyphen character (in ascii). Since a large number of existing identifiers
use uppercase letters, an exclusions file is used to disable the identifier
check on a file by file basis.

Differential Revision: https://phabricator.services.mozilla.com/D104414
2021-02-11 17:35:29 +00:00
Sylvestre Ledru
c77f092e54 Bug 1690959 - docs: Mozlint/rust - Fix the link to the source r=linter-reviewers,andi DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D104160
2021-02-05 09:48:03 +00:00
Mark Banner
abafccf4d7 Bug 1687650 - Rework Lint and ESLint document pages to provide a better layout and more information for ESLint itself. r=firefox-source-docs-reviewers,sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D103168
2021-01-29 09:09:12 +00:00
Mark Banner
787d4fd95d Bug 1686226 - Add references to the Matrix Lint & Formatting room in the coding style docs. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D101463
2021-01-12 15:04:35 +00:00
Kartik Gautam
8828f6896c Bug 1682817 - Make whitespace/newline linter also fail for absent newline character at the end of files and also implement fix for it r=sylvestre
Depends on D100484

Differential Revision: https://phabricator.services.mozilla.com/D100443
2021-01-07 08:53:16 +00:00
Kartik Gautam
5a1125a101 Bug 1675131 - Make whitespace / newline linter also fail for missing empty lines at the end of files. r=sylvestre DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D98000
2020-12-15 21:49:43 +00:00
Sylvestre Ledru
38008eb1cd Bug 1676514 - Add --fix to mozlint/clippy
I will add a test once this feature is considered as stable upstream

Differential Revision: https://phabricator.services.mozilla.com/D96634
2020-11-17 12:03:33 +00:00
Sylvestre Ledru
3c813005a1 Bug 1667831 - doc: fix more warnings r=firefox-source-docs-reviewers,ahal DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D91642
2020-09-29 18:48:17 +00:00
ruchikabgosain
5e3cc11a26 Bug 1587022 - Improve documentation for Mozilla specific ESLint rules. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D52626
2020-09-29 15:18:56 +00:00
Sylvestre Ledru
f23398e021 no bug - Update the pylint doc r=andi DONTBUILD
Also do that to verify reviewbot

Differential Revision: https://phabricator.services.mozilla.com/D90075
2020-09-14 10:34:37 +00:00
Sylvestre Ledru
5ea6c250c3 Bug 1657926 - firefox doc: fix some warnings r=championshuttler
Differential Revision: https://phabricator.services.mozilla.com/D86732
2020-08-11 23:20:25 +00:00
Tom Prince
2244b1cc7c Bug 1651731: [lint] Only allow files that are typically executable to have shebang lines override permission check; r=linter-reviewers,sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D82949
2020-07-09 21:16:32 +00:00
Chris AtLee
d1fb386dae Bug 1555560: Add support for black formatting with mozlint; r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D33125
2020-07-08 22:08:08 +00:00
Mihai Alexandru Michis
5f385df474 Backed out 2 changesets (bug 1555560) for causing multiple lint failures.
CLOSED TREE

Backed out changeset bd9460ac6e48 (bug 1555560)
Backed out changeset f2896032ced6 (bug 1555560)
2020-07-09 01:04:18 +03:00
Chris AtLee
7f8f324f06 Bug 1555560: Add support for black formatting with mozlint; r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D33125
2020-07-08 19:35:49 +00:00
Sylvestre Ledru
56fbafd822 Bug 1647265 - mozlint: when type is 'regex', add the capability to ignore the case r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D80477
2020-06-23 21:45:16 +00:00
Sylvestre Ledru
f47f1968a4 Bug 1623024 - mozlint: Add pylint as new linter r=linter-reviewers,ahal
Differential Revision: https://phabricator.services.mozilla.com/D79076
2020-06-18 20:04:50 +00:00
Sylvestre Ledru
47b3629cd9 Bug 1642825 - mozlint: Add a linter to prevent further use of black/whitelist r=Gijs,linter-reviewers,mossop,ahal
Note that I cannot do unit test because of it doesn't support regex payload
''Failed: could not resolve a lint function from''

Differential Revision: https://phabricator.services.mozilla.com/D78158
2020-06-16 17:02:59 +00:00
Sylvestre Ledru
7de68c2cea Bug 1642898 - Remove most of the references of black/whitelist within the doc r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D78000
2020-06-03 09:34:12 +00:00
Sylvestre Ledru
fedde13549 Bug 1636494 - doc: update the doc about some of the lint job moved to tier-2 r=linter-reviewers,ahal
Depends on D74435

Differential Revision: https://phabricator.services.mozilla.com/D74436
2020-05-13 09:32:57 +00:00
Ian Moody
a52653c73c Bug 1536556 - Extend no-throw-cr-literal ESLint rule to forbid and fix throw new Error(Cr.ERROR);. r=Standard8
Code should be using `throw Components.Exception("", Cr.ERROR);` instead,
since `new Error()` just converts the int value of the Cr.ERROR into a string,
whereas `Exception` constructs an Exception object with the result property set
to the Cr.ERROR value, so other code can identify it.

Differential Revision: https://phabricator.services.mozilla.com/D28074
2020-05-05 17:43:39 +00:00
Ian Moody
85f9392bc8 Bug 1536556 - Add custom no-throw-cr-literal ESLint rule, and enable it by default. r=Standard8
This rule is based on the ESLint built-in no-throw-literal. Cr.ERRORs are also
literals since they are just integers and so have all the same disadvantages of
no stack info.

TestInterfaceJS.js is explicitly testing handling of throwing raw Cr.ERRORs and
thus needs to stay.

Differential Revision: https://phabricator.services.mozilla.com/D28072
2020-05-05 15:00:50 +00:00
Sylvestre Ledru
ee37eb29a7 Bug 1466070 - Integrate clang-format into mozlint r=linter-reviewers,ahal
For now, the local detection sucks. I will fix that once bug 1625884
is fixed

Differential Revision: https://phabricator.services.mozilla.com/D69683

--HG--
extra : moz-landing-system : lando
2020-04-15 20:39:32 +00:00
Sylvestre Ledru
7cfa120eb9 Bug 1623320 - Add support to run mozlint on dotfile r=linter-reviewers,ahal
Differential Revision: https://phabricator.services.mozilla.com/D67316

--HG--
extra : moz-landing-system : lando
2020-03-20 21:51:03 +00:00