mirror of
https://github.com/ru-de/faq.git
synced 2024-12-22 17:01:49 +00:00
commit
fd05826a5b
26
.travis.sh
26
.travis.sh
@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
go build spell-checker.go
|
||||
|
||||
EXIT_CODE=0
|
||||
|
||||
git diff HEAD^ --name-only > changed_files
|
||||
|
||||
while read FILE; do
|
||||
echo -n "Проверка файла $FILE на опечатки... ";
|
||||
|
||||
OUTPUT_RU=$(cat "$FILE" | hunspell -d ru_RU | ./spell-checker);
|
||||
RU_EXIT_CODE=$?
|
||||
OUTPUT_EN=$(cat "$FILE" | hunspell -d en_US | ./spell-checker);
|
||||
EN_EXIT_CODE=$?
|
||||
|
||||
if [ $RU_EXIT_CODE -ne 0 ] || [ $EN_EXIT_CODE -ne 0 ]; then
|
||||
EXIT_CODE=1;
|
||||
echo "ошибка";
|
||||
echo "$OUTPUT_RU\n$OUTPUT_EN" | sort -n -k1,4;
|
||||
else
|
||||
echo "пройдена";
|
||||
fi
|
||||
done < changed_files
|
||||
|
||||
exit $EXIT_CODE
|
@ -4,7 +4,7 @@ before_install:
|
||||
- curl -s http://extensions.libreoffice.org/extension-center/russian-spellcheck-dictionary.-based-on-works-of-aot-group | grep -oP "http://extensions.libreoffice.org/extension-center/russian-spellcheck-dictionary.-based-on-works-of-aot-group/pscre[^\"]+" | sort -r | head -1 | wget -q -i - -O dictionary.otx
|
||||
- unzip dictionary.otx
|
||||
script:
|
||||
- sh .travis.sh
|
||||
- sh files/.travis.sh
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
29
files/.travis.sh
Normal file
29
files/.travis.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
DIR=`dirname $0`
|
||||
EXIT_CODE=0
|
||||
|
||||
go build -o $DIR/spell-checker $DIR/spell-checker.go
|
||||
|
||||
git diff HEAD^ --name-status | grep "^D" -v | awk '{print $2}' > changed_files
|
||||
|
||||
while read FILE; do
|
||||
echo -n "Проверка файла $FILE на опечатки... ";
|
||||
|
||||
OUTPUT_RU=$(cat "$FILE" | hunspell -d ru_RU | $DIR/spell-checker);
|
||||
RU_EXIT_CODE=$?
|
||||
OUTPUT_EN=$(cat "$FILE" | hunspell -d en_US | $DIR/spell-checker);
|
||||
EN_EXIT_CODE=$?
|
||||
|
||||
if [ $RU_EXIT_CODE -ne 0 ] || [ $EN_EXIT_CODE -ne 0 ]; then
|
||||
EXIT_CODE=1;
|
||||
echo "ошибка";
|
||||
echo "$OUTPUT_RU\n$OUTPUT_EN" | sort -n -k2;
|
||||
else
|
||||
echo "пройдена";
|
||||
fi
|
||||
|
||||
echo
|
||||
done < changed_files
|
||||
|
||||
exit $EXIT_CODE
|
@ -56,4 +56,4 @@ func parseHunspellOutput(scanner *bufio.Scanner) map[string]*TypeResult {
|
||||
}
|
||||
|
||||
return types
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user