mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add a "make indent" target, but watch out with using its result.
The "astyle" indent tool unfortunately behaves significantly different in its different versions (1.22, 1.23, 1.24) even with identical options. That is, the basic indentation is the same, but in a large project such as ours, there are just too many special cases which astyle doesn't get identical due to its bugfixes and new features. Hence, please use the result of this target with great care, and if in doubt, just use it for your own amusement but don't commit the resulting changes. Thanks! git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18760 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
10
Makefile.am
10
Makefile.am
@@ -195,3 +195,13 @@ ChangeLog: NEWS
|
||||
$(XSLTPROC) --stringparam strip-prefix "gnucash/trunk" \
|
||||
--stringparam include-rev "yes" $(srcdir)/macros/svn2cl.xsl - > $@
|
||||
endif
|
||||
|
||||
ASTYLE = /usr/bin/astyle
|
||||
.PHONY: indent
|
||||
indent:
|
||||
$(ASTYLE) --indent=spaces=4 --brackets=break --suffix=none `find ${srcdir}/src -name '*.[hc]'`
|
||||
# Use the following line if you've got astyle-1.24, but don't use
|
||||
# --pad=oper with astyle 1.22 as it will reformat e.g. "return +1;" in
|
||||
# a very ugly way.
|
||||
# $(ASTYLE) --indent=spaces=4 --brackets=break --pad-oper -pad-header --suffix=none `find ${srcdir}/src -name '*.[hc]'`
|
||||
@echo "### GnuCash development hint: The above command might have re-indented much more files than what you intended. Please commit only those which you really want to have changed, and revert the changes in the others so that other devevelopers do not have unnecessary merge conflicts. Thanks! ###"
|
||||
|
||||
Reference in New Issue
Block a user