-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
215 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,40 @@ | ||
#!/bin/bash | ||
|
||
DEBUG=0 # Set to 0 for no debugging, 1 for debugging | ||
ARGS=${ARGS:-} # Set to "-v" for debugging | ||
SCRIPTDIR=$(cd $(dirname "$0"); pwd) # Pick up full path to scripts from wherever doxify.sh lives | ||
|
||
for file in "$@"; do | ||
nwarnings=0 | ||
|
||
if $(python $SCRIPTDIR/is_fypp.py $file) ; then exit 0; fi | ||
for file in "$@"; do | ||
"${SCRIPTDIR}/is_fypp.py" "${file}" && continue | ||
|
||
# generate temp-file names | ||
tmp_file1=`mktemp` | ||
tmp_file2=`mktemp` | ||
tmp_file3=`mktemp` | ||
|
||
# First apply the pre-processing script to get rid of any double & type lines | ||
$SCRIPTDIR/remove_double_ampersands.pl $file $tmp_file1 $DEBUG | ||
tmp_file=`mktemp` | ||
|
||
# Run the fixcomments.pl script. This adds comment blocks to any subroutine/function | ||
# definitions that don't have any and checks that existing comments are complete, | ||
# fixing these if required. | ||
$SCRIPTDIR/fixcomments.pl $tmp_file1 $tmp_file2 $DEBUG | ||
|
||
# After adding comments, remove any double comment header lines | ||
$SCRIPTDIR/remove_extra_comments.pl $tmp_file2 $tmp_file3 $DEBUG | ||
# * First apply the pre-processing script to get rid of any double & type lines | ||
# * Run the fixcomments.pl script. This adds comment blocks to any subroutine/function | ||
# definitions that don't have any and checks that existing comments are complete, | ||
# fixing these if required. | ||
# * After adding comments, remove any double comment header lines | ||
"${SCRIPTDIR}/remove_double_ampersands.pl" ${ARGS} "${file}" \ | ||
| "${SCRIPTDIR}/fixcomments.pl" ${ARGS} \ | ||
| "${SCRIPTDIR}/remove_extra_comments.pl" ${ARGS} > "${tmp_file}" | ||
|
||
# Copy the final modified source file on top of the original file | ||
if (! cmp -s $file $tmp_file3) ; then | ||
cp $tmp_file3 $file | ||
if ! cmp -s "${file}" "${tmp_file}" ; then | ||
cp "${tmp_file}" "${file}" | ||
fi | ||
|
||
# Remove temp-files | ||
rm -f $tmp_file1 $tmp_file2 $tmp_file3 | ||
# Remove temp-file | ||
rm -f "${tmp_file}" | ||
|
||
if grep -e "UNMATCHED_PROCEDURE_ARGUMENT" \ | ||
-e "UNKNOWN_DOXYGEN_COMMENT" \ | ||
-e "UNKNOWN_COMMENT" \ | ||
$file ; then | ||
echo "Found doxify warnings in $file" | ||
exit 42 | ||
"${file}" ; then | ||
echo "Found doxify warnings in ${file}" | ||
((nwarnings++)) | ||
fi | ||
|
||
done | ||
|
||
#EOF | ||
exit ${nwarnings} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
#!/usr/bin/env python | ||
|
||
import sys, re | ||
|
||
FYPP_SYMBOLS = r"(#|\$|@)" | ||
FYPP_LINE = r"^\s*" + FYPP_SYMBOLS + r":" | ||
FYPP_INLINE = r"(" + FYPP_SYMBOLS + r"{|}" + FYPP_SYMBOLS + r")" | ||
FYPP_RE = re.compile(r"(" + FYPP_LINE + r"|" + FYPP_INLINE + r")") | ||
|
||
infile = open(sys.argv[1], 'r') | ||
for line in infile.readlines(): | ||
if FYPP_RE.search(line): | ||
with open(sys.argv[1], "r") as infile: | ||
if any(FYPP_RE.search(l) for l in infile): | ||
sys.exit(0) | ||
|
||
sys.exit(1) |
Oops, something went wrong.