-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make spell test a proper test and not a standalone script
- Loading branch information
Showing
3 changed files
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 9 additions & 4 deletions
13
ci/travis/check_spelling.sh → scripts/spell_check/spell_test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,25 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
export PATH=${HOME}/osgeo4travis/bin:${PATH} | ||
|
||
|
||
echo "Spell check" | ||
cd $(git rev-parse --show-toplevel) | ||
|
||
if [[ ! -z $TRAVIS_PULL_REQUEST_BRANCH ]]; then | ||
# if on a PR, just analyse the changed files | ||
echo "TRAVIS PR BRANCH: $TRAVIS_PULL_REQUEST_BRANCH" | ||
FILES=$(git diff --diff-filter=AM --name-only $(git merge-base HEAD master) | tr '\n' ' ' ) | ||
else | ||
export PATH=${HOME}/osgeo4travis/bin:${PATH} | ||
elif [[ ! -z $TRAVIS_COMMIT_RANGE ]]; then | ||
echo "TRAVIS COMMIT RANGE: $TRAVIS_COMMIT_RANGE" | ||
FILES=$(git diff --diff-filter=AM --name-only ${TRAVIS_COMMIT_RANGE/.../..} | tr '\n' ' ' ) | ||
export PATH=${HOME}/osgeo4travis/bin:${PATH} | ||
else | ||
echo "Runnng spell test on all files (might take a while)" | ||
FILES="" | ||
fi | ||
|
||
if [[ ! -z $FILES ]]; then | ||
./scripts/spell_check/check_spelling.sh -r $FILES | ||
DIR=$(git rev-parse --show-toplevel)/scripts/spell_check | ||
${DIR}/check_spelling.sh -r $FILES | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4021490
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@3nids what do you think about splitting off this test to it's own travis build? Since it doesn't require building of qgis it'd make sense to get results from this asap. This would also help speed up the results from the main test build.
We could potentially add other non-functional tests like a copyright header check to this other build too. And possibly the indentation test (although that currently requires building qgis_style, so we'd need to address that). Maybe we could split the indent check from the python pep8 checks and just run the latter in the non-build travis environment....
4021490
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed it makes a lot of sense. I will have a look at it.
4021490
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe documentation test could be moved there too, no?