New Feature: Add .editorconfig Support#259
Merged
Merged
Conversation
…ocessing.
Closes #215
Found these while adding EditorConfig support. This is NOT a breaking change, since this will only make the tool MORE permissive.
The approach I've gone for puts `.editorconfig` settings above those settings in
the `ecs.php` config itself, to prioritize convenience for those people using
pre-built sets. As many setttings as I could easily implement have been
supported, including one proposed (but not standardized) setting I like to
use.
This commit includes tests, documentation, and dogfooding.
Tests only currently cover the parsing of `.editorconfig`, but do not test
how all permutations affect configuration. Doing so would require advanced
alias mocks of the `EditorConfigFactory` and it's `load` method, which I wasn't
able to get working in an initial attempt. That, or a refactor of
`ECSConfigBuilder` to allow injecting the factory, but I didn't want to mess
with any of the exposed public API.
Closes #217
samsonasik
reviewed
Jan 31, 2025
c3b82b3 to
d8eb232
Compare
Member
Author
|
@samsonasik Could I ask you for review here? I'll resolve and finish it at once then |
samsonasik
approved these changes
Jan 31, 2025
Member
Author
|
Awesome :) |
Member
Author
|
Thank you @Kenneth-Sills 🚀 |
samsonasik
reviewed
Jan 31, 2025
| class EditorConfig | ||
| { | ||
| public function __construct( | ||
| public readonly ?IndentStyle $indentStyle, |
Collaborator
There was a problem hiding this comment.
this seems cause downgrade build error, see
I will look into it.
Collaborator
There was a problem hiding this comment.
it seems due to enum usage
enum IndentStyle: string
{
case Space = 'space';
case Tab = 'tab';
}I think we can just use class and constant.
Collaborator
There was a problem hiding this comment.
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.
Rebase of #234
Closes https://github.com/easy-coding-standard/easy-coding-standard/issues/217