Commit 69e63089 authored by Daniel Duarte's avatar Daniel Duarte
Browse files

Merge branch 'testPy' into 'develop'

Test py

See merge request R3/apps/spellchecker!2
parents a3ddf533 d213b793
Pipeline #19018 failed with stage
in 50 seconds
FROM bash AS bash
FROM buildpack-deps:jessie-curl
FROM git-r3lab.uni.lu:4567/r3/apps/spellchecker:aspell-0.60.8 as aspell
# use proprietary image to test
ENV ASPELL_SERVER ftp://ftp.gnu.org/gnu/aspell
ENV ASPELL_VERSION 0.60.8
ENV ASPELL_EN 2019.10.06-0
RUN apt-get update && apt-get install -y --no-install-recommends build-essential
RUN curl -SLO "${ASPELL_SERVER}/aspell-${ASPELL_VERSION}.tar.gz"
RUN curl -SLO "${ASPELL_SERVER}/dict/en/aspell6-en-${ASPELL_EN}.tar.bz2"
RUN tar -xzf "/aspell-${ASPELL_VERSION}.tar.gz"
RUN tar -xjf "/aspell6-en-${ASPELL_EN}.tar.bz2"
WORKDIR "/aspell-${ASPELL_VERSION}"
RUN ./configure
RUN make
RUN make install
RUN ldconfig
WORKDIR "/aspell6-en-${ASPELL_EN}"
RUN ./configure
RUN make
RUN make install
WORKDIR /
#ADD ./dictionaries /usr/local/lib/aspell-0.60/.
#ADD ./spellchecker .
\ No newline at end of file
ADD ./spellchecker .
CMD bash test_spell_check.sh
\ No newline at end of file
#!/bin/bash
set -e
echo "Spell checking"
spell_check_code=0
for x in $(find external/ -name '*.md');
version=`aspell --version`
echo $version
aspellOptions=`cat aspellOptions.txt`
echo "using the following aspell command:"
echo $aspellOptions
echo
for x in $(find spellCheck/ -name '*.md');
do
lines=`cat $x | aspell --lang=en --mode=markdown --encoding=utf-8 --add-extra-dicts=.aspell.en.pws --add-extra-dicts=.aspell-exceptions.en.pws --add-extra-dicts=.aspell-api-exceptions.en.pws list 2>errors.txt |wc -l`
if [ $lines -gt 0 ]
then
echo $x:
cat $x | aspell --lang=en --mode=markdown --encoding=utf-8 --add-extra-dicts=.aspell.en.pws --add-extra-dicts=.aspell-exceptions.en.pws --add-extra-dicts=.aspell-api-exceptions.en.pws list
spell_check_code=1
echo
fi
cmdLines=`cat $x | aspell $aspellOptions list`
echo $cmdLines
# note: cmdLines is the command
# $( . ): executes the command
# $(( . )): converts the result from wc -l into a number
# lines=$(($(eval $cmdLines)))
# if [ $lines -gt 0 ]
# then
# echo $x:
# cat $x | aspell $aspellOptions list
# spell_check_code=1
# echo
# fi
# we need to check stderr - in case something really bad happens there will be output there
lines=`cat errors.txt | wc -l`
if [ $lines -gt 0 ]
then
cat errors.txt
spell_check_code=1
fi
# cmdLines="cat errors.txt | wc -l"
# lines=$(($(eval $cmdLines)))
# if [ $lines -gt 0 ]
# then
# cat errors.txt
# spell_check_code=1
# fi
done
if [ $spell_check_code -gt 0 ]
then
echo "Spell check found some problems. Either fix them or add exceptions to the dictionary file: .aspell.en.pws"
fi
rm errors.txt
#rm errors.txt
exit $spell_check_code
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment