Skip to content

Commit

Permalink
Simplify default properties loading (#2679)
Browse files Browse the repository at this point in the history
The file path will be checked in `com.pinterest.ktlint.rule.engine.internal.EditorConfigDefaultsLoader.load`, no need to check nullability again.
  • Loading branch information
Goooler authored Jun 1, 2024
1 parent 58a5365 commit fc164be
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,9 @@ public class EditorConfigDefaults(
path: Path?,
propertyTypes: Set<PropertyType<*>>,
): EditorConfigDefaults =
if (path == null) {
EMPTY_EDITOR_CONFIG_DEFAULTS
} else {
EditorConfigDefaultsLoader(
EditorConfigLoaderEc4j(propertyTypes),
).load(path)
}
EditorConfigDefaultsLoader(
EditorConfigLoaderEc4j(propertyTypes),
).load(path)

/**
* Empty representation of [EditorConfigDefaults].
Expand Down

0 comments on commit fc164be

Please sign in to comment.