Code Monkey home page Code Monkey logo

autopretty's Introduction

Autopretty - the automated code prettifier

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.

1st usage

  1. Install Copier
  2. Install pre-commit
  3. Enter your project folder: cd my-project
  4. Make it a git repo: git init
  5. Run copier copy https://github.com/copier-org/autopretty.git .
  6. Answer questions
  7. Activate pre-commit: pre-commit install
  8. Commit: git commit -am 'Apply autoprettier' (repeat if pre-commit reformats anything and makes the update fail)
  9. Update your code pre-commit run -a
  10. Commit: git commit -am 'Run pre-commit'

Get updates

  1. Enter your project folder: cd my-project
  2. Update: copier -a .copier-answers.autopretty.yml update
  3. Answer questions, if anything changed
  4. Commit: git commit -am 'Update autoprettier' (repeat if pre-commit reformats anything and makes the update fail)
  5. Update your code pre-commit run -a
  6. Commit: git commit -am 'Run pre-commit'

Notes for template maintainers

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.

autopretty's People

Contributors

joao-p-marques avatar wskertic avatar yajo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.