-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add formatting feature #25
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
78f1919
:sparkles: Adds the ability to automatically format the code
rickstaa e7fd133
:memo: Updates README.md
rickstaa d7e5d99
:bug: Fixes DockerFile syntax error
rickstaa 42f4234
:art: Seperates linting and formatting steps
rickstaa a57ccbd
:green_heart: Updates gh-action test to test formatting option
rickstaa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you remove this feature or use reviewdog -f=diff instead to support code suggestion instead of committing whole changes w/o reviewdog?
If it just runs the formatter and don't need reviewdog, you should create a different action which doesn't require reviewdog and users should use the action instead.
You can refer to https://github.com/reviewdog/action-suggester
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.
@haya14busa I now changed the action such that the formatting action is seperate from the annotation action. As a result, the formatting is only done when the user explicitly asks for the files to be formatted. Consequently, review dog only receives the unformatted output. What do you think about this implementation?
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.
@haya14busa I agree that committing back the changes to the pull request or repository is bad practice. I use this feature to format + annotate the code while also creating a pull-request containing the formatted code. We can also remove the stefanzweifel/git-auto-commit-action action from the README and keep the peter-evans/create-pull-request action.
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.
I mean, it's fine to create an action that format the file and use commit / pull-request actions, but in this case, you don't need to use reviewdog, so it should be better to create a separate repo.
Users can just install or run simple formatted action and then use commit / pull-request actions instead of using this reviewdog action.
My second point is that reviewdog supports code-suggestion based on diff (see action-suggester for example as written above), so if you want to support this feature, I'm very much welcome to have such feature in reviewdog actions.
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.
@haya14busa Ah I see! I will revert the formatting related changes (both in this repository and in the action-black repository) and only add the new
remark_flags
argument. I will try out if I can use the https://github.com/reviewdog/action-suggester with my actions and add a small note to this repository pointing to that action if people want to also autoformat their code.