Re: [PATCH v3 2/2] travis-ci: build documentation
Christian Couder writes: > You might also want to check: > > http://www.shellcheck.net/ Indeed, it's also an excellent tool to check for common mistakes in shell scripts (there are many, and shellcheck is good at pointing them out and explaining them). http://www.shellcheck.net/ (Available online and as a command-line tool) -- Matthieu Moy http://www-verimag.imag.fr/~moy/ -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 2/2] travis-ci: build documentation
On Wed, May 4, 2016 at 10:04 AM, Lars Schneider wrote: > > On 03 May 2016, at 17:43, Junio C Hamano wrote: > >> Lars Schneider writes: >> >>> On 02 May 2016, at 22:45, Junio C Hamano wrote: >>> larsxschnei...@gmail.com writes: > +set -e > + > +LINKS=$(grep --recursive --only-matching --no-filename --perl-regexp \ > +'(?<=linkgit:).*?(?=\[\d+\])' Documentation/* \ > +| sort -u \ > +) > + > +for LINK in $LINKS; do > +echo "Checking linkgit:$LINK..." > +test -s Documentation/$LINK.txt > +done Please separate the above link check out of this step and do so separately after the move of test body to a separate script settles. >>> >>> OK. I also wonder if the link check should rather go to the >>> "check-docs" Makefile target? >> >> That sounds like a good direction. >> >> Which in turn means that people on all platforms are welcome to run >> it, which in turn means that the script must be even more portable, >> with avoiding GNUism and bash-isms etc. > > OK. I am not that experienced with shell scripting and therefore it > is hard for me to distinguish between the different shell features. > Do you know/can you recommend the most basic shell to test/work > with? A quick Google search told me that "dash" from Ubuntu seems > to be a good baseline as it aims to support pretty much only POSIX [1]. You might also want to check: http://www.shellcheck.net/ -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 2/2] travis-ci: build documentation
Lars Schneider writes: > A quick Google search told me that "dash" from Ubuntu seems > to be a good baseline as it aims to support pretty much only POSIX [1]. Yeah that is a good and safe starting point. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 2/2] travis-ci: build documentation
Lars Schneider wrote: > OK. I am not that experienced with shell scripting and therefore it > is hard for me to distinguish between the different shell features. > Do you know/can you recommend the most basic shell to test/work > with? A quick Google search told me that "dash" from Ubuntu seems > to be a good baseline as it aims to support pretty much only POSIX [1]. Yes, I recommend dash as your /bin/sh if you're using a Debian-based system ("Debian Almquist shell") such as Ubuntu. Also, the Debian "devscripts" package has a tool called "checkbashisms" which I have also found very useful. Maybe ksh(93) or posh could be good, too, but it's been a while... I also rely on checking the manpages-posix and manpages-posix-dev in the "non-free" section of Debian ("multiverse" in Ubuntu?) -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 2/2] travis-ci: build documentation
On 03 May 2016, at 17:43, Junio C Hamano wrote: > Lars Schneider writes: > >> On 02 May 2016, at 22:45, Junio C Hamano wrote: >> >>> larsxschnei...@gmail.com writes: >>> +set -e + +LINKS=$(grep --recursive --only-matching --no-filename --perl-regexp \ +'(?<=linkgit:).*?(?=\[\d+\])' Documentation/* \ +| sort -u \ +) + +for LINK in $LINKS; do +echo "Checking linkgit:$LINK..." +test -s Documentation/$LINK.txt +done >>> >>> Please separate the above link check out of this step and do so >>> separately after the move of test body to a separate script >>> settles. >> >> OK. I also wonder if the link check should rather go to the >> "check-docs" Makefile target? > > That sounds like a good direction. > > Which in turn means that people on all platforms are welcome to run > it, which in turn means that the script must be even more portable, > with avoiding GNUism and bash-isms etc. OK. I am not that experienced with shell scripting and therefore it is hard for me to distinguish between the different shell features. Do you know/can you recommend the most basic shell to test/work with? A quick Google search told me that "dash" from Ubuntu seems to be a good baseline as it aims to support pretty much only POSIX [1]. Thanks, Lars [1] http://www.cyberciti.biz/faq/debian-ubuntu-linux-binbash-vs-bindash-vs-binshshell/ -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 2/2] travis-ci: build documentation
Lars Schneider writes: > On 02 May 2016, at 22:45, Junio C Hamano wrote: > >> larsxschnei...@gmail.com writes: >> >>> +set -e >>> + >>> +LINKS=$(grep --recursive --only-matching --no-filename --perl-regexp \ >>> +'(?<=linkgit:).*?(?=\[\d+\])' Documentation/* \ >>> +| sort -u \ >>> +) >>> + >>> +for LINK in $LINKS; do >>> +echo "Checking linkgit:$LINK..." >>> +test -s Documentation/$LINK.txt >>> +done >> >> Please separate the above link check out of this step and do so >> separately after the move of test body to a separate script >> settles. > > OK. I also wonder if the link check should rather go to the > "check-docs" Makefile target? That sounds like a good direction. Which in turn means that people on all platforms are welcome to run it, which in turn means that the script must be even more portable, with avoiding GNUism and bash-isms etc. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 2/2] travis-ci: build documentation
On 02 May 2016, at 22:45, Junio C Hamano wrote: > larsxschnei...@gmail.com writes: > >> +set -e >> + >> +LINKS=$(grep --recursive --only-matching --no-filename --perl-regexp \ >> +'(?<=linkgit:).*?(?=\[\d+\])' Documentation/* \ >> +| sort -u \ >> +) >> + >> +for LINK in $LINKS; do >> +echo "Checking linkgit:$LINK..." >> +test -s Documentation/$LINK.txt >> +done > > Please separate the above link check out of this step and do so > separately after the move of test body to a separate script > settles. OK. I also wonder if the link check should rather go to the "check-docs" Makefile target? > When you reintroduce the tests, please make sure the shell script > follow the coding style of other scripts. E.g. I do not think the > last one in the $(...) needs a backslash continuation at all. I am > assuming that you are doing this only on Linux, in which case use of > GNUism with grep may be fine. OK. Thanks for the review, Lars > >> +make check-builtins >> +make check-docs >> +make doc >> + >> +test -s Documentation/git.html >> +test -s Documentation/git.xml >> +test -s Documentation/git.1 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 2/2] travis-ci: build documentation
larsxschnei...@gmail.com writes: > +set -e > + > +LINKS=$(grep --recursive --only-matching --no-filename --perl-regexp \ > +'(?<=linkgit:).*?(?=\[\d+\])' Documentation/* \ > +| sort -u \ > +) > + > +for LINK in $LINKS; do > +echo "Checking linkgit:$LINK..." > +test -s Documentation/$LINK.txt > +done Please separate the above link check out of this step and do so separately after the move of test body to a separate script settles. When you reintroduce the tests, please make sure the shell script follow the coding style of other scripts. E.g. I do not think the last one in the $(...) needs a backslash continuation at all. I am assuming that you are doing this only on Linux, in which case use of GNUism with grep may be fine. > +make check-builtins > +make check-docs > +make doc > + > +test -s Documentation/git.html > +test -s Documentation/git.xml > +test -s Documentation/git.1 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 2/2] travis-ci: build documentation
From: Lars Schneider Build documentation as separate Travis CI job to check for documentation errors. Signed-off-by: Lars Schneider --- .travis.yml | 15 +++ ci/test-documentation.sh | 24 2 files changed, 39 insertions(+) create mode 100755 ci/test-documentation.sh diff --git a/.travis.yml b/.travis.yml index 78e433b..55299bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,6 +32,21 @@ env: # t9816 occasionally fails with "TAP out of sequence errors" on Travis CI OS X - GIT_SKIP_TESTS="t9810 t9816" +matrix: + include: +- env: Documentation + os: linux + compiler: clang + addons: +apt: + packages: + - asciidoc + - xmlto + before_install: + before_script: + script: ci/test-documentation.sh + after_failure: + before_install: - > case "${TRAVIS_OS_NAME:-linux}" in diff --git a/ci/test-documentation.sh b/ci/test-documentation.sh new file mode 100755 index 000..889e6fd --- /dev/null +++ b/ci/test-documentation.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# +# Perform sanity checks on documentation and build it. +# + +set -e + +LINKS=$(grep --recursive --only-matching --no-filename --perl-regexp \ +'(?<=linkgit:).*?(?=\[\d+\])' Documentation/* \ +| sort -u \ +) + +for LINK in $LINKS; do +echo "Checking linkgit:$LINK..." +test -s Documentation/$LINK.txt +done + +make check-builtins +make check-docs +make doc + +test -s Documentation/git.html +test -s Documentation/git.xml +test -s Documentation/git.1 -- 2.5.1 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html