Ignore clippy::match-same-arms (pedantic) in a few places (#863)

This commit is contained in:
Anders Kaseorg 2022-11-21 12:59:58 -08:00 committed by GitHub
parent 58949b564e
commit 9bcf194fdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View file

@ -77,6 +77,7 @@ pub fn main(cli: &Cli) -> Result<()> {
.arg_ref_self()
.ret(Type::new("Vec<CheckCode>"))
.vis("pub")
.line("#[allow(clippy::match_same_arms)]")
.line("match self {");
for (prefix, codes) in &prefix_to_codes {
gen = gen.line(format!(
@ -96,6 +97,7 @@ pub fn main(cli: &Cli) -> Result<()> {
.arg_ref_self()
.ret(Type::new("PrefixSpecificity"))
.vis("pub")
.line("#[allow(clippy::match_same_arms)]")
.line("match self {");
for prefix in prefix_to_codes.keys() {
let num_numeric = prefix.chars().filter(|char| char.is_numeric()).count();

View file

@ -881,6 +881,7 @@ impl CheckCode {
}
pub fn category(&self) -> CheckCategory {
#[allow(clippy::match_same_arms)]
match self {
CheckCode::E402 => CheckCategory::Pycodestyle,
CheckCode::E501 => CheckCategory::Pycodestyle,

View file

@ -337,6 +337,7 @@ pub enum PrefixSpecificity {
impl CheckCodePrefix {
pub fn codes(&self) -> Vec<CheckCode> {
#[allow(clippy::match_same_arms)]
match self {
CheckCodePrefix::A => vec![CheckCode::A001, CheckCode::A002, CheckCode::A003],
CheckCodePrefix::A0 => vec![CheckCode::A001, CheckCode::A002, CheckCode::A003],
@ -1221,6 +1222,7 @@ impl CheckCodePrefix {
impl CheckCodePrefix {
pub fn specificity(&self) -> PrefixSpecificity {
#[allow(clippy::match_same_arms)]
match self {
CheckCodePrefix::A => PrefixSpecificity::Category,
CheckCodePrefix::A0 => PrefixSpecificity::Hundreds,