Fix TableTest editorconfig caching and adds config fallbacks#2893
Open
bric3 wants to merge 4 commits intodiffplug:mainfrom
Open
Fix TableTest editorconfig caching and adds config fallbacks#2893bric3 wants to merge 4 commits intodiffplug:mainfrom
bric3 wants to merge 4 commits intodiffplug:mainfrom
Conversation
The issue is that when editoconfig changes, it was not captured by the formatter function, because the `EditorConfigProvider` was static. And currently `EditorConfigProvider` uses internally an ec4j "permanent" cache: ``` ResourcePropertiesService.builder().cache(Caches.permanent()).build(); ```
The fallback can be used when the `.editorconfig` is absent.
6d83cee to
96069a8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
tableTestFormatter's.editorconfigcache bug: It had a s taticEditorConfigProviderfield, the formatter could not see changes in the.editorconfig, as Gradle daemon is reused across invocations. Concretely, when the.editorconfigfile changed between Gradle daemon runs, the stale cached config could cause oscillating formatting (e.g., indent inserted then removed on subsequent runs).Also, to handle a missing
.editorconfigfile, this PR allows configuring the fallback values instead of always 4 spaces :tableTestFormatter().withIndentStyle("space").withIndentSize(2). This put the gradle implementation on par withthe maven one that already has this:<indentStyle>space</indentStyle><indentSize>2</indentSize>.