restake icon indicating copy to clipboard operation
restake copied to clipboard

Use precommit for formatting

Open merakrun opened this issue 2 years ago • 2 comments

Apply pre-commit (https://pre-commit.com/) for code formatting

merakrun avatar Sep 07 '22 20:09 merakrun

Thanks for this! I like the idea but will need to apply this at the right time to avoid conflicts. I also need to research if PreCommit is the right solution.

Do you think this should be applied automatically as part of a PR process?

tombeynon avatar Sep 13 '22 10:09 tombeynon

Thanks for this! I like the idea but will need to apply this at the right time to avoid conflicts. I also need to research if PreCommit is the right solution.

Do you think this should be applied automatically as part of a PR process?

Hi, Some projects do apply it as a 2nd commit to the PR but this can cause issues with people not pulling changes in the branch before adding new ones.

Ideally, it is done at the commit level (so contributors should run it via their git commit (pre-commit install adds the hook)). This can also ensure that commits have proper messaging to allow autoreleasing via semver, etc.

At some projects it is just done from time to time to adjust the formatting, etc as the different plugins enabled can be tailored via the .precommit configuration file (for example for catching spelling typos, etc)

merakrun avatar Sep 13 '22 11:09 merakrun

@merakrun thanks so much for this, I'm going to split REStake UI into a separate repo so will revisit this soon

tombeynon avatar Mar 05 '23 21:03 tombeynon