-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
feat(editorconfig): reenable editorconfig support, add cli flag to disable it #3246
feat(editorconfig): reenable editorconfig support, add cli flag to disable it #3246
Conversation
f572723
to
0e41227
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In our repository, we have command called pnpm check
that runs the Biome CLI in dev mode. If you run, you'll notice that it will break:
configuration ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ Couldn't parse the **.yml, reason: recursive wildcards must form a single path component
ELIFECYCLE Command failed with exit code 1.
We should fix that
After fixing the issue with editor config
|
0e41227
to
e636d2f
Compare
I've updated it so that error will now be printed as:
and it'll now convert that pattern into one biome can use. That |
e636d2f
to
fd8688d
Compare
But it's a regression I am experiencing in this PR. The command |
I think this is a bug on "overrides": [
{
"include": ["**/*.json"],
"formatter": {
"indentStyle": "space"
}
}
] Obviously, we can't merge this without that being resolved. I'll look into it. |
Running biome/crates/biome_service/src/settings.rs Lines 1095 to 1100 in cc65fe8
|
@ematipico I've submitted a draft PR to fix this in #3260, but I don't really like the solution. Details are in the PR. |
fd8688d
to
f453783
Compare
@ematipico This PR should be unblocked now. I went ahead and disabled the caching for json overrides because the behavior was incorrect, as discussed in #3260, despite the potential for performance regressions. |
2e6b8d5
to
cd71fd0
Compare
cb83bbe
to
c804f00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I am a bit worried about the default, and I would like to know what you think. Once settled on the default value, we can merge it :) Great work @dyc3, thank you for landing this feature
@@ -98,6 +103,7 @@ impl Default for FormatterConfiguration { | |||
bracket_spacing: Default::default(), | |||
ignore: Default::default(), | |||
include: Default::default(), | |||
use_editorconfig: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit worried about this default. It makes sense to have to true
, however this could break some formatting for users that already use Biome and have an .editorconfig
somewhere. What do you think? Should we set it false
for now, and set it to true
for v2
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be the most conservative. On the other hand, prettier enables editorconfig support by default, and keeping this behavior when migrating from prettier would be a better user experience.
I think we should set this to false by default, but when migrating from prettier, set it to true if it's unspecified.
ref: https://prettier.io/docs/en/configuration.html#editorconfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually it turns out that prettier's options.editorconfig
doesn't work at all, see: prettier/prettier#15255
So we should always turn it on when migrating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, sounds goods me!
c804f00
to
540d90a
Compare
540d90a
to
8573a71
Compare
8573a71
to
f7d7064
Compare
Summary
This PR reenables editorconfig support, and additionally adds a cli flag,
--use-editorconfig
, to control whether or not it's enabled.related to: #1724
Test Plan
I've reenabled the unit tests that I wrote for this.