Also fix the example of avoiding missing type annotations to not use the generic 'object' which would also be equivalent to 'any'.
Differential Revision: https://phabricator.services.mozilla.com/D301557
1. Move js/src/builtin/intl/UsingEnum.h to mfbt/UsingEnum.h.
2. Rename USING_ENUM to MOZ_USING_ENUM.
3. Since few developers will be using GCC locally, they may forget to list all of the enum's enumerator values and only realize they broke the GCC build after their patch is backed out of autoland. To catch this error sooner, use the GCC macro in DEBUG builds on all platforms.
Differential Revision: https://phabricator.services.mozilla.com/D295756
Replaces the Python Unicode format-character detection with the
mozcheck Rust binary. Scans for Unicode Cf category characters
(CVE-2021-42572) in parallel using rayon.
This also improves the linter: the previous Python implementation
stopped on the first offending line per file, while the Rust
implementation reports every line containing a disallowed character.
Differential Revision: https://phabricator.services.mozilla.com/D288086
Replaces the Python whitespace-checking logic with the mozcheck 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.
Differential Revision: https://phabricator.services.mozilla.com/D288085
Replaces the Python permission-checking logic with the mozcheck Rust
binary. Checks executable bits in parallel using rayon, supports
--allow-shebang and --fix modes. Falls back to building from source
locally.
Differential Revision: https://phabricator.services.mozilla.com/D288084
Replaces the built-in regex linter type with an external linter backed by
the mozcheck Rust binary. Files are scanned in parallel using rayon.
The Python wrapper builds mozcheck from source if no pre-built binary
is available.
Differential Revision: https://phabricator.services.mozilla.com/D288083
A new in-tree Rust binary (tools/lint/mozcheck/) that provides fast,
parallelized implementations of simple mozlint linters. This commit adds
the project setup and shared JSONL output infrastructure.
Differential Revision: https://phabricator.services.mozilla.com/D288081
Replaces the Python Unicode format-character detection with the
mozcheck Rust binary. Scans for Unicode Cf category characters
(CVE-2021-42572) in parallel using rayon.
This also improves the linter: the previous Python implementation
stopped on the first offending line per file, while the Rust
implementation reports every line containing a disallowed character.
Differential Revision: https://phabricator.services.mozilla.com/D288086
Replaces the Python whitespace-checking logic with the mozcheck 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.
Differential Revision: https://phabricator.services.mozilla.com/D288085
Replaces the Python permission-checking logic with the mozcheck Rust
binary. Checks executable bits in parallel using rayon, supports
--allow-shebang and --fix modes. Falls back to building from source
locally.
Differential Revision: https://phabricator.services.mozilla.com/D288084
Replaces the built-in regex linter type with an external linter backed by
the mozcheck Rust binary. Files are scanned in parallel using rayon.
The Python wrapper builds mozcheck from source if no pre-built binary
is available.
Differential Revision: https://phabricator.services.mozilla.com/D288083
A new in-tree Rust binary (tools/lint/mozcheck/) that provides fast,
parallelized implementations of simple mozlint linters. This commit adds
the project setup and shared JSONL output infrastructure.
Differential Revision: https://phabricator.services.mozilla.com/D288081
Child actors generally deal with content nodes, and those can be
adopted, in order to preserve behavior, switch to the new
.documentGlobal.
Fix + rename the use-ownerGlobal lint since now it's wrong.
.ownerDocument.defaultView is .documentGlobal, not .ownerGlobal now.
Differential Revision: https://phabricator.services.mozilla.com/D294805
Child actors generally deal with content nodes, and those can be
adopted, in order to preserve behavior, switch to the new
.documentGlobal.
Fix + rename the use-ownerGlobal lint since now it's wrong.
.ownerDocument.defaultView is .documentGlobal, not .ownerGlobal now.
Differential Revision: https://phabricator.services.mozilla.com/D294805
* Default member-initializers for bit fields are now supported in C++20.
* [[attributes]] have been used for a while now.
* Concepts are supported in C++20.
* constexpr lambdas have been supported since C++17.
* Designated initializers are supported in C++20.
* std::format (C++20) is not fully supported in GCC libstdc++ until GCC
13. Use the fmt/format.h library instead.
* Coroutines aren't allowed because Clang doesn't support them on
Windows.
* using enum is not supported in GCC 10.
Differential Revision: https://phabricator.services.mozilla.com/D294095
This removes the `no-non-semantic-token-usage` rule, which only captured a few dozen errors that are redundant with the `use-design-tokens` rule. It also expands the list of properties we're checking and adjusts the rule's behavior to cover more intended use cases.
Differential Revision: https://phabricator.services.mozilla.com/D279963
Updates Test Manifests to new conventions for the upcoming
linter patch in Bug 2004444. These conventions are documented in
docs/code-quality/lint/linters/test-manifest-toml.rst
which will get published to
https://firefox-source-docs.mozilla.org/code-quality/lint/linters/test-manifest-toml.html
Summary of changes:
- The order of comparisons/variables is now important in conditional
expressions. Certain expressions have been edited to reflect this
order (with no semantic changes).
- The variables which are tested for equality as well as all the flags
are constrained to a known set (i.e. typos in variable/flag names
will be caught by the linter)
- Older platforms which are no longer present in the CI infrastructure
have been deprecated, for example:
* ``"os == 'linux' && os_version == '18.04'
- Combinations of platforms and flags which are no longer present in
the CI infrastructure will be removed, for example:
* ``"os == 'linux' && os_version == '22.04' && asan"``
* ``"os == 'linux' && os_version == '22.04' && tsan"``
* ``"os == 'win' && tsan``
- Old platform combination flags and isLinux style flags have been
deprecated in favor of explicitly checking os, os_version, etc.
NOTE: code changes in this patch are simply to maintain self tests
and do not reflect the updated linter changes.
Signed-off-by: Tom Marble <[email protected]>
Differential Revision: https://phabricator.services.mozilla.com/D278535
This reverts commit 844b03e2a8.
Revert "Bug 2000685 - Replace Services.search with direct loading of the SearchService singleton in other code. r=mcheang,extension-reviewers,omc-reviewers,firefox-desktop-core-reviewers ,ai-frontend-reviewers,toolkit-telemetry-reviewers,hsohaney,emcminn,robwu,Gijs"
This reverts commit 94811f6708.
Revert "Bug 2000685 - Replace Services.search with direct loading of the SearchService singleton in urlbar and search code. r=mcheang"
This reverts commit b0f3b3e975.
Revert "Bug 2000685 - Replace Services.search with direct loading of the SearchService singleton in newtab code. r=mcheang,home-newtab-reviewers,nbarrett"
This reverts commit 25f775d4a2.
Revert "Bug 2000685 - Replace Services.search with direct loading of the SearchService singleton in extensions code. r=mcheang,extension-reviewers,robwu"
This reverts commit 462b01b86a.
Revert "Bug 2000685 - Replace Services.search with direct loading of the SearchService singleton in enterprise policies code. r=mcheang"
This reverts commit 7d7bbd910f.
Revert "Bug 2000685 - Replace Services.search with direct loading of the SearchService singleton in toolkit search code. r=mcheang"
This reverts commit 66fe0f4123.
Revert "Bug 2000685 - Replace the search service instance with a singleton - initial mechanical changes. r=mcheang,frontend-codestyle-reviewers"
This reverts commit eea6e5a119.
- converts use-size-tokens rule to be configured via use-design-tokens rule
- updates size and space tests/docs for use-size-tokens, because some properties use both rules
Differential Revision: https://phabricator.services.mozilla.com/D276304
When a file with .h or .hpp extension does not provide a header guard,
fail and/or provide a fix with a standard naming scheme.
Actual linter + test + documentation.
Differential Revision: https://phabricator.services.mozilla.com/D278442
This updates `use-design-tokens` rules to treat system colors like ButtonFace or CanvasText as allowed, but suggest design tokens to use instead, since they should account for forced colors or high contrast for the most part. These will be warnings rather than errors, and they won't autofix.
Differential Revision: https://phabricator.services.mozilla.com/D277941