Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Watermelon AI SummaryThis PR introduces a new feature that enhances the code quality by adding the ability to detect multi-line leftover comments, which are considered a code smell. The series of updates in the PR progressively develop, refine, and streamline this feature, while also addressing an identified error in the logic that incorrectly matches the position of comments within the code. GitHub PRs
watermelon is an open repo and Watermelon will serve it for free. |
EstebanDalelR
left a comment
There was a problem hiding this comment.
What can we extract? This is a 600 LOC file!
Code seems ok, but I think we do not want blocking commenting of files but rather choosing one?
I totally agree there's a bunch of things to abstract. I'm worrying about making it work first, then I'll worry about abstracting the code. |
|
I upgraded the PR to "ready for review". Changes include:
Considerations
CC: @EstebanDalelR
|
utils/actions/detectCodeSmells.ts
Outdated
| const { additions } = getLineDiffs(file.patch ?? ""); | ||
|
|
||
| // Leftover comment RegEx | ||
| // const leftoverCommentRegex = /^\/\*[\s\S]*?\*\//gm; |
There was a problem hiding this comment.
This seems very independent, can we split it as to call it in this function?
Other than that LGTM!

Description
Adds detecting multi-line leftover comments as a code smell
Type of change
Notes
I tested with the commit that this file has that has a leftover comment itself (already removed) and it successfully dects the leftover comment.
However, there is an error in the logic. The code gets the correct position of the occurrence of the leftover comment (number of lines below the @@ header hunk, not the actual line number in the file). However it comments the lineNumber under the wrong header hunk (the first one). Thsi needs to be fixed for this to be upgraded from draft PR.
Acceptance