This project packages the astyle utility as a Python package.
pip install astyle
Installing is not needed for pre-commit.
astyle --help
# or
python -m astyle --help
from astyle.__main__ import main
main("--help")
Or:
from astyle import astyle
astyle(" #include <Python.h>", "indent-classes")
.pre-commit-config.yaml
:
repos:
- repo: https://github.com/Freed-Wu/mirrors-astyle
rev: 3.6.4
hooks:
- id: astyle
pre-commit install
git commit
Please use https://github.com/Freed-Wu/mirrors-astyle, it uses binary wheel and will be faster than this repository which uses source code.