Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mullvad Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Mullvad Browser
Commits
55574d6e
Commit
55574d6e
authored
7 months ago
by
brizental
Committed by
clairehurst
4 weeks ago
Browse files
Options
Downloads
Patches
Plain Diff
BB 42728: Modify ./mach lint to skip unused linters
parent
54f2f856
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/mozlint/mozlint/cli.py
+33
-2
33 additions, 2 deletions
python/mozlint/mozlint/cli.py
with
33 additions
and
2 deletions
python/mozlint/mozlint/cli.py
+
33
−
2
View file @
55574d6e
...
...
@@ -10,6 +10,30 @@ from pathlib import Path
from
mozlint.errors
import
NoValidLinter
from
mozlint.formatters
import
all_formatters
# We (the Tor Project) do not use all of Mozilla's linters.
# Below is a list of linters we do not use,
# these will be skipped when running `./mach lint` commands.
INACTIVE_LINTERS
=
[
"
android-api-lint
"
,
"
android-checkstyle
"
,
"
android-format
"
,
"
android-javadoc
"
,
"
android-lint
"
,
"
android-test
"
,
"
clippy
"
,
"
codespell
"
,
"
condprof-addons
"
,
"
file-perm
"
,
"
ignorefile
"
,
"
license
"
,
"
lintpref
"
,
"
perfdocs
"
,
"
rejected-words
"
,
"
rst
"
,
"
updatebot
"
,
"
wpt
"
,
]
class
MozlintParser
(
ArgumentParser
):
arguments
=
[
...
...
@@ -276,6 +300,9 @@ def find_linters(config_paths, linters=None):
name
=
name
.
rsplit
(
"
.
"
,
1
)[
0
]
if
not
linters
and
name
in
INACTIVE_LINTERS
:
continue
if
linters
and
name
not
in
linters
:
continue
...
...
@@ -341,10 +368,14 @@ def run(
if
list_linters
:
lint_paths
=
find_linters
(
lintargs
[
"
config_paths
"
],
linters
)
linters
=
[
formatted_
linters
=
[
os
.
path
.
splitext
(
os
.
path
.
basename
(
l
))[
0
]
for
l
in
lint_paths
[
"
lint_paths
"
]
]
print
(
"
\n
"
.
join
(
sorted
(
linters
)))
print
(
"
\n
"
.
join
(
sorted
(
formatted_linters
)))
if
not
linters
:
print
(
"
\n
INACTIVE --
"
.
join
(
sorted
([
""
,
*
INACTIVE_LINTERS
])).
strip
())
print
(
"
\n
Note that clang-tidy checks are not run as part of this
"
"
command, but using the static-analysis command.
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment