-
Notifications
You must be signed in to change notification settings - Fork 25
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: add no-empty-fields rule #741
Conversation
@JoshuaKGoldberg I completed code and test cases. Maybe the code should be optimized. Please review it when you have time. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #741 +/- ##
==========================================
- Coverage 98.01% 97.88% -0.13%
==========================================
Files 18 19 +1
Lines 1408 1180 -228
Branches 133 142 +9
==========================================
- Hits 1380 1155 -225
+ Misses 28 25 -3 ☔ View full report in Codecov by Sentry. |
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 is a solid start, thanks for working on it @chouchouji! 🚀
I left some comments on making it more comprehensive in feature reporting and more targeted in how it fixes code. Please let me know if anything is unclear. 🙂
Note: some of the comments might be made irrelevant based on other comments. For example, if you end up refactoring the fix
function(s) to not use variables, the suggestion to put fix
-specific variables inside the fix
function(s) wouldn't make sense anymore.
By the way:
It's customary to put a message like
I edited that in just now. You can read more here: https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword. Cheers! 🙂 |
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.
Nice progress! I just made an additional observation about the JSON.parse
@michaelfaith @JoshuaKGoldberg Thanks, I had updated code. It seems that I am working in a right direction. Please check this video. 20250120-233127.mp4 |
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.
Much cleaner! Looks great. Left one minor (non-blocking) nit. Also, want to give @JoshuaKGoldberg a chance to take another look before calling it done. I can take care of creating the doc page that CI is blocking for, unless you'd like to take a stab at that too.
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.
Progress 🚀
@JoshuaKGoldberg @michaelfaith Thanks for your help. I had updated code. Please check this video. 20250122-200758.mp4 |
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.
Nice work on the refactor. The rule logic is looking good to me. I think fleshing out the documentation page might be all that's left, which I'm happy to help with, if you want.
Thanks. I have no experience about docs. It would be best if you could write it. |
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.
Here's a recommendation for the rule documentation. What do you think?
Thanks. I think it is very good. I had updated docs. Please review it if you have time. |
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.
Great. Nice work on this. I'll let @JoshuaKGoldberg give it another once over, but I think it's in a good spot.
One thing I'll call out is that technically this change is a breaking one, since we're adding a new rule to the recommended config. With the plugin being pre-1.0 and still forming its initial public api, I don't think that's a problem, but just mentioning it for general awareness.
Yeah the joy of being on a 0.x major is that semver explicitly allows us to add these "breaking" changes whenever we want 🚀. https://semver.org/#spec-item-4:
Obviously we're not going to go too wild with it. I personally try to keep to minor versions, rather than patch versions, for things that would be breaking in a >=1.x. |
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 is looking great, thanks!
|
||
if (tokenFromCurrentLine?.value === ",") { | ||
yield fixer.remove(tokenFromCurrentLine); | ||
} |
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 is included in version v0.21.0 🎉 The release is available on: Cheers! 📦🚀 |
PR Checklist
status: accepting prs
Overview