-
Notifications
You must be signed in to change notification settings - Fork 8
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
style: run package through styler #378
Conversation
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.
From a skim, looks fine. But what's the process for pending PRs? Git rebase --exec, something like this?
Oh, not sure if rebase styling would even be needed if we are merging PRs rather than rebasing PRs. [Maybe just a style commit per PR would do to prevent conflicts? But might need to think about whether rebase styling would make reviewing or future git blaming easier.] |
That's a nice blog post, good find! That will certainly remove the difficulty of manually sifting through git conflicts, but having to rebase each branch is still work. If we do go down that path, I'm thinking we can have each PR owner run this locally # Make sure you're on PR branch and rebase on dev
git checkout <branch>
git rebase origin/dev
# Rebase on ds/style
git rebase \
--strategy-option=theirs \
--exec 'Rscript -e "styler::style_pkg()"' \
--exec 'git add --all' \
--exec 'git commit --amend --no-edit' \
origin/ds/style
# Using the unimproved version of the command above because the
# styler command doesn't have a way to easily take output from git show
# Force push to remote
git push origin --force This way we don't force push to an author's branch and have them run into issues with their local version. If we don't go down the rebase path and have each PR owner make their own big styling commit, then we need everyone to add those to the ignore-revs file. On the plus side, this sounds less dangerous than rebase and force pushing. On the down side, the commit log will duplicate big formatting commits. |
Non-rebase approach is also going to make reviewing a hassle if it's not done at the very very end. Might ask PR authors if we can apply the rebase approach & do that then. Locally at least we should make sure to back up the old version until everything looks good. |
Co-authored-by: brookslogan <[email protected]>
As I'm trying to clean up some old PRs, I'm revisiting these handy commands. Post-merge of the styler, it looks like |
No description provided.