Skip to content
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

Suggestion feature #48

Merged
merged 7 commits into from
Sep 2, 2021
Merged

Conversation

ohbarye
Copy link
Member

@ohbarye ohbarye commented Aug 7, 2021

Issue

closes #28

Changes

This pull request adds a feature to make the reviewdog create a comment with a suggestion. Like below:

image

Here's an example pull request to utilize the feature: ohbarye/rubocop-suggestion-example#4

Design

First, I added RdjsonFormatter class in Ruby so that rubocop gets able to generate rdformat JSON. I followed some instructions to implement a new formatter, e.g. https://docs.rubocop.org/rubocop/formatters.html, https://www.rubydoc.info/gems/rubocop/RuboCop/Formatter/BaseFormatter.

Second, I added a test for RdjsonFormatter. I just followed the way of https://github.com/reviewdog/action-eslint. Add test data, shell script, and CI setting.

@gagalago
Copy link

gagalago commented Aug 9, 2021

awesome. can be interesting to upstream the RdjsonFormatter at some point to gain fix and feedback from a bigger community but I suppose that for now it better to keep it in this repository to have it faster released with reviewdog.

@ohbarye
Copy link
Member Author

ohbarye commented Aug 14, 2021

@mgrachev @adnikiforov I'd be glad if you'd review this when you have time. 🙏

@mgrachev
Copy link
Member

@ohbarye I'm sorry for the long answer. I was on vacation.

Thank you for your contribution! Please resolve a conflict 🙏

@mgrachev
Copy link
Member

Also, please fix all rubocop warnings and disable them
https://github.com/reviewdog/action-rubocop/pull/48/files#diff-09318eb08af7c21da437d23a5f268ad408b01f1f7a4a76fecaa2219f6a1bf73bR1

@ohbarye ohbarye force-pushed the rubocop-with-suggestion branch from 1f41cce to 2c47d1c Compare August 27, 2021 14:44
@ohbarye ohbarye force-pushed the rubocop-with-suggestion branch from 2c47d1c to c637e7f Compare August 27, 2021 14:49
@ohbarye
Copy link
Member Author

ohbarye commented Aug 27, 2021

@mgrachev
Sorry for leaving this PR failing on CI. 🙏
I've fixed conflicts and failures on CI, then reorganized files and directories in order to follow the preceding change.

@mgrachev mgrachev merged commit 05911ba into reviewdog:master Sep 2, 2021
@mgrachev
Copy link
Member

mgrachev commented Sep 2, 2021

@ohbarye Thanks a lot for your help 💚

@ohbarye ohbarye deleted the rubocop-with-suggestion branch September 2, 2021 15:12
@ohbarye
Copy link
Member Author

ohbarye commented Sep 2, 2021

@mgrachev Thank you for your review too! 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use suggestions?
3 participants