Skip to content
Snippets Groups Projects
Commit b9ebd9ce authored by Gareth Tribello's avatar Gareth Tribello
Browse files

Added stuff to check spelling in theory

parent a3aa0cba
No related branches found
No related tags found
No related merge requests found
......@@ -254,6 +254,7 @@ script:
- if test "$MAKEDOC" == yes ; then make -C regtest copytodoc ; fi
- if test "$MAKECOVERAGE" == yes ; then make -C developer-doc coverage ; fi
- if test "$MAKEDOC" == yes ; then make doc >/dev/null ; fi
- if test "$MAKEDOC" == yes ; then make -C user-doc spelling ; fi
- if test "$PLUMED_CXX" ; then make -C regtest checkfail ; fi
# OpenBLAS is needed for numpy, I install it separately since it takes a long time
- if test -n "$PLUMED_MACPORTS" ; then
......
......@@ -3,7 +3,7 @@ ifneq ($(MAKECMDGOALS),clean)
-include ../Makefile.conf
endif
.PHONY: all clean
.PHONY: all clean spelling
plumed_compiled := $(wildcard ../src/lib/plumed)
......@@ -25,5 +25,8 @@ ifeq ($(make_doc),yes)
endif
endif
spelling:
./go-spelling
clean:
rm -fr html latex automatic *~ *PP.txt *PP.md errors manual.pdf regtests
......@@ -47,20 +47,33 @@ for file in *PP.md automatic/*.txt ../CHANGES/*.md tutorials/*.txt tutorials/*.s
nerrors=`wc -l spelling/$fname.err | awk '{print $1}'`
# Crash out if there are spelling mistakes
if [ $nerrors -gt 0 ] ; then
echo -e "$RED>>Found spelling mistakes in documentation file $file:$NC" >> spelling_results
cat spelling/$fname.err >> spelling_results
echo -n "Found spelling mistakes in documentation file $file<< \\n " >> spelling_results
cat spelling/$fname.err | awk '{printf("%s ", $2)}' >> spelling_results
echo -n "\\n " >> spelling_results
fi
done
# Test for existance of spelling results
if [ ! -f spelling_results ] ; then
exit 0
fi
if test -z $TRAVIS ; then
cat spelling_results
cat spelling_results # | sed -e s/\\n/^M/g
# If not a pull request add a comment on the commit message
elif [ $TRAVIS_PULL_REQUEST=="false" ] ; then
ASPELL_RESULTS=`cat spelling_results`
curl -i -H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
-X POST -d "{\"body\":\"$ASPELL_RESULTS\"}" \
https://api.github.com/repos/plumed/plumed2/commits/$TRAVIS_COMMIT/comments
# If it is a pull request comment on the pull request
else
ASPELL_RESULTS=`cat spelling_results`
curl -i -H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/json" \
-X POST -d "{\"body\":\"$ASPELL_RESULTS\"}" \
https://api.github.com/repos/plumed/plumed2/comments/1
https://api.github.com/repos/plumed/plumed2/issues/$TRAVIS_PULL_REQUEST/comments
fi
rm -f spelling_results
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment