Add astyle formatter (#169)

This commit is contained in:
Mohsin Kaleem 2023-04-22 10:36:38 +01:00 committed by GitHub
parent bc6b72c05d
commit 0290ae18cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 1 deletions

View file

@ -21,8 +21,10 @@ The format is based on [Keep a Changelog].
* [`gawk`](https://www.gnu.org/software/gawk/) for
[awk](https://en.wikipedia.org/wiki/AWK) ([#187]).
* [`asmfmt`](https://github.com/klauspost/asmfmt) for assembly ([#168]).
* [`astyle`](https://github.com/steinwurf/astyle) for C ([#169]).
[#168]: https://github.com/radian-software/apheleia/pull/168
[#169]: https://github.com/radian-software/apheleia/pull/169
[#174]: https://github.com/radian-software/apheleia/pull/174
[#182]: https://github.com/radian-software/apheleia/pull/182
[#187]: https://github.com/radian-software/apheleia/pull/187

View file

@ -32,7 +32,9 @@
:link '(emacs-commentary-link :tag "Commentary" "apheleia"))
(defcustom apheleia-formatters
'((asmfmt . ("asmfmt"))
'((astyle . ("astyle" (apheleia-formatters-locate-file
"--options" ".astylerc")))
(asmfmt . ("asmfmt"))
(bean-format . ("bean-format"))
(black . ("black"
(when (apheleia-formatters-extension-p "pyi") "--pyi")

View file

@ -0,0 +1 @@
apt-get install -y astyle

View file

@ -0,0 +1 @@
../clang-format/in.c

View file

@ -0,0 +1,5 @@
// https://www.ioccc.org/2020/burton/prog.c
int main(int b,char**i) {
long long n=B,a=I^n,r=(a/b&a)>>4,y=atoi(*++i),_=(((a^n/b)*(y>>T)|y>>S)&r)|(a^r);
printf("%.8s\n",(char*)&_);
}