Adding make style
This commit is contained in:
parent
568317929d
commit
723e2860ae
2 changed files with 11 additions and 3 deletions
5
HACKING
5
HACKING
|
@ -11,8 +11,9 @@ Here are some directions to get you started:
|
||||||
is consistent in style and thus easier to read.
|
is consistent in style and thus easier to read.
|
||||||
Look around and respect the same style.
|
Look around and respect the same style.
|
||||||
Don't use tabs. Increment unit is two spaces.
|
Don't use tabs. Increment unit is two spaces.
|
||||||
Don't leave dandling spaces or tabs at EOL. Helper script:
|
Don't leave dandling spaces or tabs at EOL.
|
||||||
$ find . -name '*.[ch]' -exec perl -pi -e 's/[ \t]+$//;' {} \;
|
Helper script to get some uniformity in the style:
|
||||||
|
$ make style
|
||||||
|
|
||||||
2. Chase warnings: no warning should be introduced by your changes
|
2. Chase warnings: no warning should be introduced by your changes
|
||||||
Depending what you touch, you can check with:
|
Depending what you touch, you can check with:
|
||||||
|
|
|
@ -16,7 +16,7 @@ CLEANFILES = Doxygen.log coverage.info libnfc.pc
|
||||||
|
|
||||||
clean-local: clean-local-doc clean-local-coverage
|
clean-local: clean-local-doc clean-local-coverage
|
||||||
|
|
||||||
.PHONY: clean-local-coverage clean-local-doc doc
|
.PHONY: clean-local-coverage clean-local-doc doc style
|
||||||
clean-local-coverage:
|
clean-local-coverage:
|
||||||
-rm -rf coverage
|
-rm -rf coverage
|
||||||
|
|
||||||
|
@ -28,3 +28,10 @@ doc : Doxyfile
|
||||||
|
|
||||||
DISTCHECK_CONFIGURE_FLAGS="--with-drivers=all"
|
DISTCHECK_CONFIGURE_FLAGS="--with-drivers=all"
|
||||||
|
|
||||||
|
style:
|
||||||
|
find . -name "*.[ch]" -exec perl -pi -e 's/[ \t]+$$//' {} \;
|
||||||
|
find . -name "*.[ch]" -exec astyle --formatted --mode=c --suffix=none \
|
||||||
|
--indent=spaces=2 --indent-switches --indent-preprocessor \
|
||||||
|
--keep-one-line-blocks --max-instatement-indent=60 \
|
||||||
|
--brackets=linux --pad-oper --unpad-paren --pad-header \
|
||||||
|
--align-pointer=name {} \;
|
||||||
|
|
Loading…
Add table
Reference in a new issue