Autoformatter of source code with git hooks
To use this package, run the following command in your project's root directory:
Put the following dependency into your project's dependences section:
Wraps existing tools for formatting of source code in a handy package with integration with git.
autoformat depend on the following packages:
- D compiler (dmd 2.079+, ldc 1.11.0+)
It is recommended to install the D compiler by downloading it from the official distribution page.
# link https://dlang.org/download.html curl -fsS https://dlang.org/install.sh | bash -s dmd
For users running Ubuntu some of the dependencies can be installed with apt.
sudo apt install astyle clang-format
The easiest way to now run autoformat is by using dub:
dub run autoformat
Otherwise you can clone the repo, build and install manually.
git clone https://github.com/joakim-brannstrom/autoformat.git cd autoformat dub build -b release
Copy the files from autoformat/build to wherever you want them
Done! Have fun. Don't be shy to report any issue that you find.
It couldn't be easier. Make sure that autoformat is in your PATH.
To install the git hooks:
autoformat -i path/to/directory/with/a/.git
When the hook is being installed it will prompt for one of three options. Choose the configuration you like.
Now whenever you do a git commit it will check/format the changed files.
- Registered by Joakim Brännström
- ~master released 12 months ago
- Copyright © 2017, Joakim Brännström
- colorlog, my, sumtype
1.0.0 2022-Jun-03 0.0.1 2019-Aug-08 ~master 2022-Jun-03
- Download Stats:
0 downloads today
0 downloads this week
0 downloads this month
22 downloads total
- Short URL: