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

Set tabWidth: 2 in Prettier config #2438

Merged
merged 3 commits into from
Mar 3, 2022
Merged

Conversation

eemeli
Copy link
Member

@eemeli eemeli commented Feb 26, 2022

As discussed on Matrix & last week's call.

This PR will need to be followed by a separate change updating the .git-blame-ignore-revs file.

If you need to rebase work past this style change, do as follows:

  1. Consider this to be commit commitA, replacing that with its id in the following.

  2. To make sure mistakes aren't fatal, assign a second branch to your current work.

  3. Rebase your branch on the commit immediately before this one, commitA~

  4. Run the following command at the root of the repo:

     git rebase --strategy-option=theirs \
       --exec 'npx prettier --write . && git add -u && git commit --amend --no-edit' \
       commitA
    

That will take a short while esp. if you have multiple commits, as it runs Prettier on everything for every commit. If you've deleted files, the rebase may drop down to interactive mode and have you git rm as appropriate, then git rebase --continue.

You should end up with just your changes in your branch, prettily formatted. To validate that, apply the same Prettier config change to your original branch, reformat the files with npm run prettier, and then compare the results with the rebased branch.

If you need to rebase work past this style change, do as follows:

0. Consider this to be commit `commitA`, replacing that with its id in the following.
1. To make sure mistakes aren't fatal, assign a second branch to your current work.
2. Rebase your branch on the commit immediately before this one, commitA~
3. Run the following command at the root of the repo:

    git rebase --strategy-option=theirs \
      --exec 'npx prettier --write . && git add -u && git commit --amend --no-edit' \
      commitA

That will take a short while esp. if you have multiple commits,
as it runs Prettier on everything for every commit.
If you've deleted files, the rebase may drop down to interactive mode
and have you `git rm` as appropriate, then `git rebase --continue`.

You should end up with just your changes in your branch,
prettily formatted. To validate that,
apply the same Prettier config change to your original branch,
reformat the files with `npm run prettier`,
and then compare the results with the rebased branch.
@eemeli eemeli marked this pull request as ready for review March 3, 2022 03:15
@eemeli eemeli requested a review from mathjazz March 3, 2022 03:15
@@ -122,13 +122,13 @@ pyupgrade:
"${DC}" run --rm server pyupgrade --exit-zero-even-if-changed --py38-plus *.py `find pontoon -name \*.py`

check-pyupgrade:
"${DC}" run --rm webapp pyupgrade --py38-plus *.py `find pontoon -name \*.py`
"${DC}" run --rm server pyupgrade --py38-plus *.py `find pontoon -name \*.py`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😅

@mathjazz mathjazz merged commit 9faea69 into mozilla:master Mar 3, 2022
@eemeli eemeli deleted the tabwidth-2 branch March 3, 2022 12:08
eemeli added a commit to eemeli/pontoon that referenced this pull request Mar 8, 2022
mathjazz pushed a commit that referenced this pull request Mar 8, 2022
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.

2 participants