Skip to content
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

feat(noSecrets): refine the entropy computation to avoid some false positives #4118

Merged
merged 18 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions crates/biome_analyze/src/rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub enum RuleSource {
EslintTypeScript(&'static str),
/// Rules from [Eslint Plugin Unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
EslintUnicorn(&'static str),
/// Rules from [Eslint Plugin Unused Imports](https://github.com/sweepline/eslint-plugin-unused-imports)
/// Rules from [Eslint Plugin Unused Imports](https://github.com/sweepline/eslint-plugin-unused-imports)
EslintUnusedImports(&'static str),
/// Rules from [Eslint Plugin Mysticatea](https://github.com/mysticatea/eslint-plugin)
EslintMysticatea(&'static str),
Expand All @@ -128,6 +128,8 @@ pub enum RuleSource {
EslintN(&'static str),
/// Rules from [Stylelint](https://github.com/stylelint/stylelint)
Stylelint(&'static str),
/// Rules from [Eslint Plugin No Secrets](https://github.com/nickdeis/eslint-plugin-no-secrets)
EslintNoSecrets(&'static str),
}

impl PartialEq for RuleSource {
Expand Down Expand Up @@ -159,6 +161,7 @@ impl std::fmt::Display for RuleSource {
Self::EslintBarrelFiles(_) => write!(f, "eslint-plugin-barrel-files"),
Self::EslintN(_) => write!(f, "eslint-plugin-n"),
Self::Stylelint(_) => write!(f, "Stylelint"),
Self::EslintNoSecrets(_) => write!(f, "eslint-plugin-no-secrets"),
}
}
}
Expand Down Expand Up @@ -207,7 +210,8 @@ impl RuleSource {
| Self::EslintMysticatea(rule_name)
| Self::EslintBarrelFiles(rule_name)
| Self::EslintN(rule_name)
| Self::Stylelint(rule_name) => rule_name,
| Self::Stylelint(rule_name)
| Self::EslintNoSecrets(rule_name) => rule_name,
Conaclos marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand All @@ -232,6 +236,7 @@ impl RuleSource {
Self::EslintBarrelFiles(rule_name) => format!("barrel-files/{rule_name}"),
Self::EslintN(rule_name) => format!("n/{rule_name}"),
Self::Stylelint(rule_name) => format!("stylelint/{rule_name}"),
Self::EslintNoSecrets(rule_name) => format!("no-secrets/{rule_name}"),
}
}

Expand All @@ -257,6 +262,7 @@ impl RuleSource {
Self::EslintBarrelFiles(rule_name) => format!("https://github.com/thepassle/eslint-plugin-barrel-files/blob/main/docs/rules/{rule_name}.md"),
Self::EslintN(rule_name) => format!("https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/{rule_name}.md"),
Self::Stylelint(rule_name) => format!("https://github.com/stylelint/stylelint/blob/main/lib/rules/{rule_name}/README.md"),
Self::EslintNoSecrets(_) => "https://github.com/nickdeis/eslint-plugin-no-secrets/blob/master/README.md".to_string(),
}
}

Expand Down
Loading
Loading