-
-
Notifications
You must be signed in to change notification settings - Fork 839
fix(linter): reduce noSecrets false positives on CamelCase identifiers
#8832
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
Conversation
…iomejs#8809) Enhanced the entropy calculation for CamelCase identifiers to prevent false positives in secret detection. Added tests for CamelCase and alternating case patterns to ensure correct behavior. Updated relevant test cases in and to reflect these changes.
🦋 Changeset detectedLatest commit: 683f042 The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Hi, I tried to assign @dyc3 as a reviewer, but I don't have the appropriate permissions. |
WalkthroughThe entropy calculation in the Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ematipico
left a comment
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.
Awesome improvement! Can you create a changeset? https://github.com/biomejs/biome?tab=contributing-ov-file#create-a-changeset
…ncing the rule, adding changeset
CodSpeed Performance ReportMerging this PR will improve performance by 9.07%Comparing Summary
Performance Changes
Footnotes
|
dyc3
left a comment
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.
This is great! Thank you!
|
It seems very odd to me to hard code paddingBottom |
Summary
noSecretsrule for CamelCase/PascalCase identifiers likepaddingBottom,IngestGatewayLogGroup, andunhandledRejection.Test plan
cargo test -p biome_js_analyze -- no_secretsFixes #8809
Fixes #7985
Fixes #8136
Detailed Description
Problem
The
noSecretsrule was incorrectly flagging common CamelCase identifiers as potential secrets:Root Cause
The entropy calculation treated all case switches equally without distinguishing between:
Gateway= 1 uppercase + 6 lowercaseaBcDeFg= alternating every characterSolution
Introduced "average run length" metric to detect CamelCase patterns:
Results
IngestGatewayLogGroupunhandledRejectionaBcDeFgHiJkLmNoPq