-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lint] Enforce k prefix for global constants #33666
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chinmaygarde
approved these changes
May 27, 2022
cbracken
force-pushed
the
enforce-k-constants
branch
from
May 27, 2022 20:12
6ee6363
to
70abe88
Compare
Enforces that all global constants are prefixed with a 'k' as per the style guide and updates the codebase into conformance where necessary. This does not change any public API (or touch even private header files). Additional testing provided by the addition of the lint rule. Ref: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#begin-global-constant-names-with-prefix-k
cbracken
force-pushed
the
enforce-k-constants
branch
from
May 27, 2022 20:51
70abe88
to
f538d18
Compare
jmagman
reviewed
May 27, 2022
cbracken
force-pushed
the
enforce-k-constants
branch
from
May 27, 2022 22:16
f0ab2a4
to
b515912
Compare
cbracken
force-pushed
the
enforce-k-constants
branch
from
May 27, 2022 22:30
b515912
to
2b1c1d6
Compare
jmagman
approved these changes
May 27, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Chris!
We're stuck with these; bummer.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 28, 2022
cbracken
added a commit
to cbracken/flutter_engine
that referenced
this pull request
May 28, 2022
In flutter#33666, I landed a bulk lint cleanup that applied fixes to global constant naming using the `--fix` option to the linter script, but also caught a few straggling linter violations that hadn't been previously fixed. As part of this patch, the linter applied a change that moved ShaderLibraryGLES's is_valid_ initialisation from the ctor body to the initialiser list, always initialised to true. This is unsafe because prior to is_valid_ initialisation in the ctor body, there was a bailout if any of the shader_libraries wasn't valid.
8 tasks
cbracken
added a commit
to cbracken/flutter_engine
that referenced
this pull request
May 28, 2022
In flutter#33666, I landed a bulk lint cleanup that applied fixes to global constant naming using the `--fix` option to the linter script, but also caught a few straggling linter violations that hadn't been previously fixed. As part of this patch, the linter applied a change that moved ShaderLibraryGLES's is_valid_ initialisation from the ctor body to the initialiser list, always initialised to true. This is unsafe because prior to is_valid_ initialisation in the ctor body, there was a bailout if any of the shader_libraries wasn't valid. This eliminates the use of the cppcoreguidelines-prefer-member-initializer lint, which incorrectly flagged this code due to the following issue: llvm/llvm-project#52837
cbracken
added a commit
to cbracken/flutter_engine
that referenced
this pull request
May 28, 2022
In flutter#33666, I landed a bulk lint cleanup that applied fixes to global constant naming using the `--fix` option to the linter script, but also caught a few straggling linter violations that hadn't been previously fixed. As part of this patch, the linter applied a change that moved ShaderLibraryGLES's is_valid_ initialisation from the ctor body to the initialiser list, always initialised to true. This is unsafe because prior to is_valid_ initialisation in the ctor body, there was a bailout if any of the shader_libraries wasn't valid. This eliminates the use of the cppcoreguidelines-prefer-member-initializer lint, which incorrectly flagged this code due to the following issue: llvm/llvm-project#52837 This is a partial revert of flutter#33666
cbracken
added a commit
that referenced
this pull request
May 29, 2022
In #33666, I landed a bulk lint cleanup that applied fixes to global constant naming using the `--fix` option to the linter script, but also caught a few straggling linter violations that hadn't been previously fixed. As part of this patch, the linter applied a change that moved ShaderLibraryGLES's is_valid_ initialisation from the ctor body to the initialiser list, always initialised to true. This is unsafe because prior to is_valid_ initialisation in the ctor body, there was a bailout if any of the shader_libraries wasn't valid. This eliminates the use of the `cppcoreguidelines-prefer-member-initializer` lint, which incorrectly flagged this code due to the following issue: llvm/llvm-project#52837 This is a partial revert of #33666. Reintroduction of this issue is prevented by the removal of the `cppcoreguidelines-prefer-member-initializer` lint in this patch.
houhuayong
pushed a commit
to houhuayong/engine
that referenced
this pull request
Jun 21, 2022
Enforces that all global constants are prefixed with a 'k' as per the style guide and updates the codebase into conformance where necessary. This does not change any public API. Additional testing provided by the addition of the lint rule. Ref: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#begin-global-constant-names-with-prefix-k
houhuayong
pushed a commit
to houhuayong/engine
that referenced
this pull request
Jun 21, 2022
In flutter#33666, I landed a bulk lint cleanup that applied fixes to global constant naming using the `--fix` option to the linter script, but also caught a few straggling linter violations that hadn't been previously fixed. As part of this patch, the linter applied a change that moved ShaderLibraryGLES's is_valid_ initialisation from the ctor body to the initialiser list, always initialised to true. This is unsafe because prior to is_valid_ initialisation in the ctor body, there was a bailout if any of the shader_libraries wasn't valid. This eliminates the use of the `cppcoreguidelines-prefer-member-initializer` lint, which incorrectly flagged this code due to the following issue: llvm/llvm-project#52837 This is a partial revert of flutter#33666. Reintroduction of this issue is prevented by the removal of the `cppcoreguidelines-prefer-member-initializer` lint in this patch.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enforces that all global constants are prefixed with a 'k' as per the
style guide and updates the codebase into conformance where necessary.
This does not change any public API (or touch even private header
files).
Additional testing provided by the addition of the lint rule.
Ref: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#begin-global-constant-names-with-prefix-k
Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.