Files
sousa-gecko/tools/lint/dot-mozilla-reference.yml
T
Sylvestre Ledru af85ad4db0 Bug 2036399 - Rewrite dot-mozilla-reference linter to use mozcheck (Rust) r=gerard-majax
Switches the avoid-dot-mozilla-without-xdg rule from the generic Python
regex backend to the mozcheck Rust rejected-words check. The existing
pattern matching ".mozilla" or '.mozilla' (case-insensitive) maps
directly onto rejected-words, so no Rust changes are required — only
the YAML configuration is updated.

The Python regex backend often takes 3 to 5 minutes to run this rule
across the tree; the Rust implementation is significantly faster.

Differential Revision: https://phabricator.services.mozilla.com/D297900
2026-05-13 12:19:45 +00:00

51 lines
1.8 KiB
YAML

---
avoid-dot-mozilla-without-xdg:
description: >-
New code is hard-coding ".mozilla" which is referencing the path on
Linux, should ensure it is handled with XDG configuration paths. See
the documentation for more info.
level: error
include: ['.']
type: external
payload: mozcheck:lint
check: rejected-words
check-config:
regex-pattern: "\"\\.mozilla\"|'\\.mozilla'"
ignore-case: true
support-files:
- 'tools/lint/mozcheck/**'
extensions:
- js
- mjs
- jsx
- cpp
- c
- h
- configure
- py
- properties
- yml
- yaml
- java
- kt
- rs
exclude:
# Files which reference .mozilla but are not referencing the Linux path
- tools/lint/dot-mozilla-reference.yml
- taskcluster/kinds/source-test/mozlint.yml
- browser/components/originattributes/test/browser/browser_firstPartyIsolation_aboutPages.js
- browser/components/originattributes/test/browser/browser_firstPartyIsolation_js_uri.js
- caps/OriginAttributes.cpp
- toolkit/components/resistfingerprinting/nsRFPService.cpp
- docshell/base/URIFixup.sys.mjs
- netwerk/cookie/CookieCommons.cpp
- toolkit/components/antitracking/test/browser/browser_thirdPartyChecks_sandboxed_context.js
# Files which reference .mozilla and have XDG handling in place
- testing/talos/talos/heavy.py
- toolkit/crashreporter/crash_helper_server/src/logging/env.rs
- toolkit/moz.configure
- toolkit/xre/nsXREDirProvider.cpp
- toolkit/xre/test/marionette/xdg_config/test_xdg_config_legacy_existing.py
- toolkit/tests/gtest/TestXREAppDir.cpp
- xpcom/io/nsAppFileLocationProvider.cpp