-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve support of default editorconfig properties #1580
Merged
paul-dingemans
merged 12 commits into
pinterest:master
from
paul-dingemans:1551-editorconfig-path-cli
Aug 18, 2022
Merged
Improve support of default editorconfig properties #1580
paul-dingemans
merged 12 commits into
pinterest:master
from
paul-dingemans:1551-editorconfig-path-cli
Aug 18, 2022
Conversation
This file contains 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
Deprecate ExperimentalParams.editorConfigDefaults in favor of new parameter ExperimentalParams.editorConfigDefaults. When used in the old implementation this resulted in ignoring all ".editorconfig" files on the path to the file. The new implementation uses properties from the "editorConfigDefaults" parameter only when no ".editorconfig" files on the path to the file supplies this property for the filepath. Closes pinterest#1551 API consumers can easily create the EditConfigDefaults by calling "EditConfigDefaults.load(path)" or creating it programmatically. The CLI still supports the "--editorconfig=" option but has improved support. The path given can be either be a path to file or directory. In case of a directory path, it is expected that the directory does contain a file with name ".editorconfig". In of a file path, any valid file name is accepted. The path can be relative or absolute. Depending on the OS, the "~" at the start of the path is accepted as well. BaseCLITest no longer always waits 3 seconds for completion of the asynchronous process. Once the process is started, it checks every 100 ms whether the process is still alive (e.g. is running) and stops polling otherwise resulting in better performance (most notable on local machine). The maximum duration of the CLI test has been increased to 10 seconds.
… (automatically trimmed)
… 1551-editorconfig-path-cli
shashachu
reviewed
Aug 15, 2022
shashachu
reviewed
Aug 15, 2022
shashachu
reviewed
Aug 17, 2022
ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/api/UsesEditorConfigProperties.kt
Show resolved
Hide resolved
# Conflicts: # CHANGELOG.md # ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/internal/EditorConfigLoader.kt # ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/internal/PreparedCode.kt # ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/internal/ThreadSafeEditorConfigCache.kt # ktlint-core/src/test/kotlin/com/pinterest/ktlint/core/internal/EditorConfigLoaderTest.kt # ktlint/src/main/kotlin/com/pinterest/ktlint/internal/KtlintCommandLine.kt
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.
Description
Deprecate ExperimentalParams.editorConfigPath in favor of new parameter ExperimentalParams.editorConfigDefaults. When used in the old implementation this resulted in ignoring all ".editorconfig" files on the path to the file. The new implementation uses properties from the "editorConfigDefaults" parameter only when no ".editorconfig" files on the path to the file supplies this property for the filepath.
Closes #1551
API consumers can easily create the EditConfigDefaults by calling "EditConfigDefaults.load(path)" or creating it programmatically.
The CLI still supports the "--editorconfig=" option but has improved support. The path given can be either be a path to file or directory. In case of a directory path, it is expected that the directory does contain a file with name ".editorconfig". In of a file path, any valid file name is accepted. The path can be relative or absolute. Depending on the OS, the "~" at the start of the path is accepted as well.
BaseCLITest no longer always waits 3 seconds for completion of the asynchronous process. Once the process is started, it checks every 100 ms whether the process is still alive (e.g. is running) and stops polling otherwise resulting in better performance (most notable on local machine). The maximum duration of the CLI test has been increased to 10 seconds.
Checklist
CHANGELOG.md
is updatedIn case of adding a new rule: