Skip to content

Commit

Permalink
updated list of R linters
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Sep 29, 2019
1 parent 5689a5e commit b8cd181
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 26 deletions.
15 changes: 0 additions & 15 deletions .ci/lint_r_code.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,16 @@ FILES_TO_LINT <- list.files(
# We build lintr from source to address that.
linters_on_cran <- list(
"closed_curly" = lintr::closed_curly_linter
, "equals_na" = lintr::equals_na_linter
, "function_left" = lintr::function_left_parentheses_linter
, "infix_spaces" = lintr::infix_spaces_linter
, "implicit_integers" = lintr::implicit_integer_linter
, "long_lines" = lintr::line_length_linter(length = 120)
, "tabs" = lintr::no_tab_linter
, "open_curly" = lintr::open_curly_linter
, "paren_brace_linter" = lintr::paren_brace_linter
, "semiconlon" = lintr::semicolon_terminator_linter
, "seq" = lintr::seq_linter
, "spaces_inside" = lintr::spaces_inside_linter
, "spaces_left_parens" = lintr::spaces_left_parentheses_linter
, "todo_comments" = lintr::todo_comment_linter
, "true_false" = lintr::T_and_F_symbol_linter
, "trailing_blank" = lintr::trailing_blank_lines_linter
, "trailing_white" = lintr::trailing_whitespace_linter
)

github_only_linters <- list(
lintr::equals_na_linter
, lintr::function_left_parentheses_linter
, lintr::paren_brace_linter
, lintr::semicolon_terminator_linter
)

LINTERS_TO_USE <- c(
linters_on_cran
, github_only_linters
Expand Down
13 changes: 2 additions & 11 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,13 @@ if [[ $TASK == "lint" ]]; then
conda install -q -y -n $CONDA_ENV \
pycodestyle \
pydocstyle \
r
# lintr has to be installed from source to get new linters. Pegging to a specific commit
# so this project's CI isn't at the whim of bleeding-edge changes to lintr
LINTR_CLONE_DIR=./lintr_temp
git clone https://github.com/jimhester/lintr.git ${LINTR_CLONE_DIR}
pushd ${LINTR_CLONE_DIR}
git reset --hard 9fb12a5ca1854320729b62a88d39a42e111d97ea
R CMD install .
popd
rm -rf ${LINTR_CLONE_DIR}
r-lintr
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
echo "Linting R code"
Rscript ${BUILD_DIRECTORY}/.ci/lint_r_code.R ${BUILD_DIRECTORY}
Rscript ${BUILD_DIRECTORY}/.ci/lint_r_code.R ${BUILD_DIRECTORY} || exit -1
echo "Linting C++ code"
cpplint \
--filter=-build/include_subdir,-build/header_guard,-whitespace/line_length \
Expand Down

0 comments on commit b8cd181

Please sign in to comment.