Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Oct 18, 2023
1 parent 7eb8fe6 commit 9f5ec1c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
6 changes: 3 additions & 3 deletions crates/biome_service/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ impl OverrideSettings {

if included == Some(true) || excluded == Some(false) {
if let Some(enabled) = pattern.formatter.enabled {
return Some(enabled == false);
return Some(!enabled);
}
}
}
Expand All @@ -599,7 +599,7 @@ impl OverrideSettings {

if included == Some(true) || excluded == Some(false) {
if let Some(enabled) = pattern.linter.enabled {
return Some(enabled == false);
return Some(!enabled);
}
}
}
Expand All @@ -614,7 +614,7 @@ impl OverrideSettings {

if included == Some(true) || excluded == Some(false) {
if let Some(enabled) = pattern.organize_imports.enabled {
return Some(enabled == false);
return Some(!enabled);
}
}
}
Expand Down
28 changes: 11 additions & 17 deletions crates/biome_service/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,12 @@ impl FileFeaturesResult {
let formatter_disabled =
if let Some(disabled) = settings.override_settings.formatter_disabled(path) {
disabled
} else if language.is_javascript_like() {
!settings.formatter().enabled || settings.javascript_formatter_disabled()
} else if language.is_json_like() {
!settings.formatter().enabled || settings.json_formatter_disabled()
} else {
if language.is_javascript_like() {
!settings.formatter().enabled || settings.javascript_formatter_disabled()
} else if language.is_json_like() {
!settings.formatter().enabled || settings.json_formatter_disabled()
} else {
!settings.formatter().enabled
}
!settings.formatter().enabled
};
if formatter_disabled {
self.features_supported
Expand All @@ -150,11 +148,9 @@ impl FileFeaturesResult {
self.features_supported
.insert(FeatureName::Lint, SupportKind::FeatureNotEnabled);
}
} else {
if !settings.linter().enabled {
self.features_supported
.insert(FeatureName::Lint, SupportKind::FeatureNotEnabled);
}
} else if !settings.linter().enabled {
self.features_supported
.insert(FeatureName::Lint, SupportKind::FeatureNotEnabled);
}

// organize imports
Expand All @@ -163,11 +159,9 @@ impl FileFeaturesResult {
self.features_supported
.insert(FeatureName::OrganizeImports, SupportKind::FeatureNotEnabled);
}
} else {
if !settings.organize_imports().enabled {
self.features_supported
.insert(FeatureName::OrganizeImports, SupportKind::FeatureNotEnabled);
}
} else if !settings.organize_imports().enabled {
self.features_supported
.insert(FeatureName::OrganizeImports, SupportKind::FeatureNotEnabled);
}

self
Expand Down

0 comments on commit 9f5ec1c

Please sign in to comment.