mozlinter: port some linters to Rust
Categories
(Developer Infrastructure :: Lint and Formatting, task)
Tracking
(Not tracked)
People
(Reporter: Sylvestre, Assigned: Sylvestre, NeedInfo)
References
(Blocks 1 open bug, Regressed 2 open bugs)
Details
(Keywords: leave-open)
Attachments
(14 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
Bug 2023411 - Fix trailing whitespace in 4 files found by file-whitespace linter r?#linter-reviewers
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
| Assignee | ||
Comment 1•2 months ago
|
||
Replaces the built-in regex linter type with an external linter backed by
the moz-linter Rust binary. Files are scanned in parallel using rayon.
The Python wrapper builds moz-linter from source if no pre-built binary
is available.
| Assignee | ||
Comment 2•2 months ago
|
||
Replaces the Python permission-checking logic with the moz-linter Rust
binary. Checks executable bits in parallel using rayon, supports
--allow-shebang and --fix modes. Falls back to building from source
locally.
| Assignee | ||
Comment 3•2 months ago
|
||
Replaces the Python whitespace-checking logic with the moz-linter Rust
binary. Detects and fixes trailing whitespace, missing final newlines,
empty trailing lines, and Windows CRLF line endings. Files are processed
in parallel using rayon.
| Assignee | ||
Comment 4•2 months ago
|
||
Replaces the Python Unicode format-character detection with the
moz-linter Rust binary. Scans for Unicode Cf category characters
(CVE-2021-42572) in parallel using rayon.
| Assignee | ||
Comment 5•2 months ago
|
||
| Assignee | ||
Comment 6•2 months ago
|
||
Implement license check in Rust: validates files contain a recognized
license pattern, adds appropriate headers in fix mode, and checks
toolkit/content/license.html references.
Comment 7•2 months ago
|
||
If we port the regex ones, we could fix bug 1959706.
Comment 8•2 months ago
|
||
Ah https://phabricator.services.mozilla.com/D288083 is doing that ;)
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Comment 10•2 months ago
|
||
| bugherder | ||
Comment 11•2 months ago
|
||
| bugherder | ||
Comment 12•2 months ago
|
||
Reopened for unpublished changesets.
Comment 13•1 month ago
|
||
| Assignee | ||
Comment 14•1 month ago
|
||
Addresses review comment from sergesanspaille on D288083. The inner
function was named after its execution strategy (run_lint_in_parallel)
rather than what it checks; rename it to check_reject_words and update
the batch.rs caller to match.
| Assignee | ||
Comment 15•1 month ago
|
||
Addresses nit from sergesanspaille on D288084: make the intent of the
mode & 0o111 == 0 guard explicit with a "not executable" comment.
Comment 16•1 month ago
|
||
Comment 17•1 month ago
|
||
| bugherder | ||
| Assignee | ||
Comment 18•1 month ago
|
||
Comment 19•1 month ago
|
||
Comment 20•1 month ago
|
||
| bugherder | ||
| Assignee | ||
Comment 21•1 month ago
|
||
Replaces the Python MinGW header capitalization check with the mozcheck
Rust binary. Validates that Windows #include directives use lowercase
header names matching the MinGW headers list.
| Assignee | ||
Comment 22•1 month ago
|
||
Move android_os_to_api_map out of mozinfo/platforminfo.py and into
mozinfo/android_os_to_api_map.yaml so it can be consumed both by Python
(mozinfo) and by Rust (tools/lint/mozcheck via include_str!).
| Assignee | ||
Comment 23•1 month ago
|
||
Comment 24•1 month ago
|
||
Comment 25•1 month ago
|
||
Comment 26•1 month ago
|
||
Comment 27•1 month ago
|
||
Reverted this because it was causing mass failures.
Comment 28•1 month ago
|
||
Comment 29•1 month ago
|
||
| bugherder | ||
Updated•1 month ago
|
| Assignee | ||
Comment 30•27 days ago
|
||
Rust port of testing/mozbase/manifestparser/manifestparser/, exposed as a
new crate at testing/mozbase/rust/manifestparser/.
Modules:
- util / ini : path normalization, INI manifest reader, combine_fields
- expression : Pratt-style boolean expression evaluator (nom-lexed)
- filters : skip-if/run-if/fail-if + chunkers + tags + pathprefix
- token : quote-aware whitespace normalization (strip_unquoted)
- parser : nom-based primitives shared with downstream consumers
(Op, CmpOp, parse_op, split_ops) - toml : read_toml + sort_paths
- manifest : ManifestParser + TestManifest with active_tests pipeline
The tomlkit-backed formatter helpers (alphabetize_toml_str, add_skip_if,
remove_skip_if, replace_tbd_skip_if) are intentionally not ported because
they depend on tomlkit's stylistic round-trip with no Rust equivalent.
The token vocabulary (legal os/os_version/etc. values) lives with the
test-manifest-toml linter, which loads it from YAML at runtime, rather
than being hardcoded here a second time.
| Assignee | ||
Comment 31•27 days ago
|
||
The MinGW capitalization linter requires Windows SDK headers to use
lowercase filenames so the MinGW build can resolve them. The previous
Python implementation was a silent no-op due to a re.search(line, re.I)
bug (the re.I flag was being passed as the pos argument), so these
five files slipped in with <Mferror.h> / <Mfidl.h>. The new mozcheck
Rust port catches them; lowercase the includes to match the headers list.
Comment 32•27 days ago
|
||
Comment 33•26 days ago
|
||
| bugherder | ||
Comment 34•26 days ago
|
||
Comment 35•26 days ago
|
||
| bugherder | ||
Updated•25 days ago
|
Description
•