Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Tor Browser
Commits
f46ff037
Commit
f46ff037
authored
Jul 31, 2024
by
brizental
Committed by
Pier Angelo Vendrame
3 months ago
Browse files
Options
Downloads
Patches
Plain Diff
BB 42728: Modify ./mach lint to skip unused linters
parent
dc5db97a
No related branches found
No related tags found
1 merge request
!1503
TB 43415, part 3: Shuffle commits
Changes
1
Show 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 @
f46ff037
...
...
@@ -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