-
Notifications
You must be signed in to change notification settings - Fork 657
fix(rome_cli): do not pull diagnostics if linter is turned off #3171
Conversation
✅ Deploy Preview for rometools canceled.
|
@@ -0,0 +1,24 @@ | |||
--- |
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 test case is valid. rome ci
doesn't attempt to format files if they contain diagnostics, so I created a snippet that doesn't emit lint diagnostics.
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.
What's the motivation of not formatting files that have lint diagnostics? Shouldn't we show a user all errors to avoid the "Rust" experience where you fix a syntax error, to then get a compile error, to then get a borrow checker error.
This is something that frustrated me a couple of times with Rust because it results in a slow feedback cycle and I may not run rome format
only to then see on CI that there are also formatting errors.
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.
Sorry. I think I misunderstood.
We do format and check files that have lint errors but we don't format files that have syntax errors. That makes sense.
@ematipico When can you release a new version with this fix? This is quite an important issue |
After we fix #3175, for sure. Probably tomorrow |
Summary
This PR fixes #3167
Diagnostics were pulled regardless of the capability of the workspace. I added a small condition before the pulling of diagnostics.
Test Plan
I created two test cases: one where the formatter is enabled and linter disabled, one where the formatter is disabled and the linter enabled