Skip to content

Commit

Permalink
cleaned up linting block in test.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Nov 16, 2019
1 parent 400213a commit 2b68d2f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,25 @@ if [[ $TRAVIS == "true" ]] && [[ $TASK == "check-docs" ]]; then
exit 0
fi

if [[ $TASK == "lint" ]]; then
if [[ $TRAVIS == "true" ]] && [[ $TASK == "lint" ]]; then
conda install -q -y -n $CONDA_ENV \
pycodestyle \
pydocstyle
pip install --user cpplint
echo "Linting Python code"
pycodestyle --ignore=E501,W503 --exclude=./compute,./.nuget . || exit -1
pydocstyle --convention=numpy --add-ignore=D105 --match-dir="^(?!^compute|test|example).*" --match="(?!^test_|setup).*\.py" . || exit -1

# stringi and r-lintr
echo "Linting R code"
# stringi needs to be installed separate from r-lintr
# to avoid issues like 'unable to load shared object stringi.so'
conda install -y -n $CONDA_ENV \
r-stringi
conda install -y -n $CONDA_ENV \
-c conda-forge \
r-lintr>=2.0
echo "Linting R code"
Rscript ${BUILD_DIRECTORY}/.ci/lint_r_code.R ${BUILD_DIRECTORY} || exit -1

echo "Linting C++ code"
cpplint --filter=-build/c++11,-build/include_subdir,-build/header_guard,-whitespace/line_length --recursive ./src ./include || exit 0

exit 0
fi

Expand Down

0 comments on commit 2b68d2f

Please sign in to comment.