Skip to content

Commit

Permalink
apply formatting fixes when no lint fixes are enabled
Browse files Browse the repository at this point in the history
Previously, format fixes were not applied unless lint fixes were enabled.
  • Loading branch information
JohannesIBK committed May 16, 2024
1 parent 062f0fd commit 74aca0f
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,22 @@ class BiomeStdinRunner(private val project: Project) : BiomeRunner {
private fun getCheckFlags(features: EnumSet<Feature>): List<String> {
val args = SmartList<String>()

if (features.isEmpty()) return args

if (features.contains(Feature.Format)) {
args.add("--formatter-enabled=true")
} else {
args.add("--formatter-enabled=false")
}

if (features.contains(Feature.SafeFixes) && !features.contains(Feature.UnsafeFixes)) {
args.add("--apply")
if (!features.contains(Feature.SafeFixes) && !features.contains(Feature.UnsafeFixes)) {
args.add("--linter-enabled=false")
}

if (features.contains(Feature.UnsafeFixes)) {
args.add("--apply-unsafe")
} else {
args.add("--apply")
}

return args
Expand Down

0 comments on commit 74aca0f

Please sign in to comment.