-
Notifications
You must be signed in to change notification settings - Fork 11
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
[WIP] [POC] Add linter to CLI #22
base: master
Are you sure you want to change the base?
Conversation
This is such a cool idea! Really looking forward to this. One question with respect to the bot. Is the idea, essentially, that the bot would run |
No, that wasn't the original intent. I was more thinking it would call out to The only change is the The main changes (which is hard to see since there is no diff), is that I decoupled the That all said, it might not be a bad idea for the bot to be able to call out to The main reason I shoved it in this repo (to start) is we already had an executable this is basically in all of the repos, and was available via a |
Nice. Yeah putting it in this repo is fine, and then we can figure out if it ultimately lives here, or lives standalone.
Perfect! Decoupling that is a great move. |
Random Side Musing: So something I was digging into (because it was bothering me) was why that Turns out, there is a part of the " Specifically, the Which is what removes the lines that are not part of the diff. There are two things here that are think should be done:
Regarding number 2, I think that is a relic that existed prior to the Regardless, moving this logic over should fix the issue I was seeing where the lines parsed were everything wrong with the file in the source branch (when compared to the merge target), and not just what was part of the diff. |
Only pulling in Branch and Diff, since those are the only two that are used for the linter.
Allows linting of single branch, or targeted file from that branch. Currently only running `Rubocop` (since that is all I had available to test against), but the concept should work for the other linters as well.
400e645
to
bcb245d
Compare
With the
pronto
effort sort of not being done... "proto"...(...more like DOA, but ゚。・* . ゚☆ puns ☆゚.*・ 。゚)
I wanted something to take over for the
miqbot
CLI proposal that I had, and since this is included in every repo now, this seemed like a good fit.A majority of the code is gutted from the bot, and just slightly tweeked and repurposed here. Additionally, I think we could easily be remove that code from the bot now, and have it call out to this library, but I think it might make more sense long term to make the linter code a lightweight gem (or possibly just the
git_service
portion as something likerugged-code_diff
).Regardless, I just wanted to provide this change as is for a first pass review
Example run
Note: This test was run prior to ManageIQ/manageiq#20997 being merged, but I there was no change on
Gemfile
line 7, so I think there is still some work to be done here.An alternative run using the
rubocop
CLI for contrast: