## ---------------------------------------------------------------------
#
-# This script indents all source files of deal.II according to our
-# usual code formatting standards. It is used to ensure that our
-# code base looks uniform, as uniformity helps make code easier to
-# read.
+# This script indents all source files of deal.II according to our usual
+# code formatting standards. It is used to ensure that our code base looks
+# uniform, as uniformity helps make code easier to read.
#
# While we're already touching every file, this script also makes
-# sure we set permissions correctly
+# sure we set permissions correctly and checks for correct unix-style line
+# endings.
#
# The script needs to be executed as
-# ./contrib/utilities/indent
+# $ ./contrib/utilities/indent
# from the top-level directory of the source tree, or via
-# make indent
+# $ make indent
# from a build directory.
#
+# Note: If the script is invoked with REPORT_ONLY=true set,
+# $ REPORT_ONLY=true ./contrib/utilities/indent
+# or,
+# $ make REPORT_ONLY=true indent
+# then indentation errors will only be reported without any actual file
+# changes.
+#
if [ ! -f contrib/utilities/indent_common.sh ]; then
echo "*** This script must be run from the top-level directory of deal.II."
#
# This script does the same thing as contrib/utilities/indent but only
# reformats files which have changed (or have been added but neither
-# staged/commited) since the last merge commit to the master branch. It
-# should be run as
-#
-# make indent-branch
+# staged/commited) since the last merge commit to the master branch.
#
+# The script needs to be executed as
+# $ ./contrib/utilities/indent-branch
+# from the top-level directory of the source tree, or via
+# $ make indent-branch
# from a build directory.
#
+# Note: If the script is invoked with REPORT_ONLY=true set,
+# $ REPORT_ONLY=true ./contrib/utilities/indent-branch
+# or,
+# $ make REPORT_ONLY=true indent-branch
+# then indentation errors will only be reported without any actual file
+# changes.
+#
if [ ! -f contrib/utilities/indent_common.sh ]; then
echo "*** This script must be run from the top-level directory of deal.II."
style guidelines outlined in this page. Alternatively, you can run
<code>
<pre>
- make indent
+ make indent-branch
</pre>
</code>
in whatever directory you set up the library to be compiled in to indent all
-source files. If you want to make sure that the indenting is correct for all
-your commits, you might want to set up a pre-commit hook. One way to do so,
-is to copy ${SOURCE_DIR}/contrib/scripts/pre-commit-clang-format to
-${SOURCE_DIR}/.git/hooks/pre-commit and make sure it is executable.
+source files that have been changed recently. If you want to make sure that
+the indenting is correct for all your commits, you might want to set up a
+pre-commit hook. One way to do so, is to copy
+<code>${SOURCE_DIR}/contrib/scripts/pre-commit-clang-format</code> to
+<code>${SOURCE_DIR}/.git/hooks/pre-commit</code> and make sure it is
+executable.
</p>
<h3>Style issues</h3>
degrees of freedom, etc) should start with <code>n_*</code>. Example:
SparsityPattern::n_nonzero_entries().</li>
-<li> %Function which set a bit or flag should start with <code>set_*</code>;
- functions which clear bits of flags should be named <code>clear_*</code>.
+<li> %Functions which set a bit or flag should start with <code>set_*</code>;
+ functions which clear bits or flags should be named <code>clear_*</code>.
Example: CellIterator::set_refine_flag().</li>
<li> Traditional logical operators should be used instead of their English