diff --git a/.travis.yml b/.travis.yml index dd0e537a1ea91b2c75ddbd541f88e6a8b4e0a454..e7245869239ba30979396fcec54a9525449235ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/user-doc/Makefile b/user-doc/Makefile index 852b25c17bbd958ec619800ba43f06663dbeb3a5..59a4868a2b2d96966edac1f5adeaaede188c2bfc 100644 --- a/user-doc/Makefile +++ b/user-doc/Makefile @@ -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 diff --git a/user-doc/go-spelling b/user-doc/go-spelling index f0bb29511a12a91dc64932373b4a4e23be23116b..b8aa36d134b38fa8a0a20bfdd1eec2db7dbd5774 100755 --- a/user-doc/go-spelling +++ b/user-doc/go-spelling @@ -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