# set as "uncrustify" (or something ending in "uncrustify") are processed: if
# other files have been changed, they are ignored by the script. Files passed
# to uncrustify, as well as files with filter "copyright", get their copyright
-# header checked.
+# header checked. To only run uncrustify for a file, set the filter to
+# "uncrustify_only".
#
# If you want to run uncrustify automatically for changes you make, there are
# two options:
git check-attr --stdin filter | \
sed -e 's/.*: filter: //' | \
paste $tmpdir/difflist - | \
- grep -E '(uncrustify|copyright)$' >$tmpdir/filtered
+ grep -E '(uncrustify|uncrustify_only|copyright)$' >$tmpdir/filtered
cut -f2 <$tmpdir/filtered >$tmpdir/filelist_all
-grep 'uncrustify$' <$tmpdir/filtered | cut -f2 >$tmpdir/filelist_uncrustify
+grep -E '(uncrustify|uncrustify_only)$' <$tmpdir/filtered | \
+ cut -f2 >$tmpdir/filelist_uncrustify
+grep 'copyright$' <$tmpdir/filtered | \
+ cut -f2 >$tmpdir/filelist_copyright
git diff-files --name-only | grep -Ff $tmpdir/filelist_all >$tmpdir/localmods
# Extract changed files to a temporary directory
fi
# TODO: Probably better to invoke python explicitly through a customizable
# variable.
- if ! $admin_dir/copyright.py -F $tmpdir/filelist_all $cpscript_args >>$tmpdir/messages
+ if ! $admin_dir/copyright.py -F $tmpdir/filelist_copyright $cpscript_args >>$tmpdir/messages
then
echo "Copyright checking failed!"
rm -rf $tmpdir