Are you tired of configuring .pre-commit-config.yaml
all over your projects, and
keeping those up-to-date?
Me too. ๐คฆโ
Thus, here's autopretty. It uses Copier to keep your projects updated with the latest code formatters and linters.
- Install Copier
- Install pre-commit
- Enter your project folder:
cd my-project
- Make it a git repo:
git init
- Run
copier copy https://github.com/copier-org/autopretty.git .
- Answer questions
- Activate pre-commit:
pre-commit install
- Commit:
git commit -am 'Apply autoprettier'
(repeat if pre-commit reformats anything and makes the update fail) - Update your code
pre-commit run -a
- Commit:
git commit -am 'Run pre-commit'
- Enter your project folder:
cd my-project
- Update:
copier -a .copier-answers.autopretty.yml update
- Answer questions, if anything changed
- Commit:
git commit -am 'Update autoprettier'
(repeat if pre-commit reformats anything and makes the update fail) - Update your code
pre-commit run -a
- Commit:
git commit -am 'Run pre-commit'
This template is self-applied, but due to ๐+๐ฅ problems, to update it, this must be done manually:
cd autopretty
copier -a .copier-answers.autopretty.upstream.yml -f -d js=false -d protected_branches=[main] . .
mv -f .github/workflows/pre-commit.yml .github/workflows/pre-commit.upstream.yml
Not so nice, but neither so hard.