diff --git a/.Rbuildignore b/.Rbuildignore index 83f840f062b3f6d4dcdc548e6458946c58f1bf70..2a2a753d061baa9dab657853b564427c97df1ec6 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -6,6 +6,7 @@ ./.nc$ .*^(?!data)\.RData$ .*\.gitlab-ci.yml$ +.lintr ^tests$ ./.nfs* ^cran-comments\.md$ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0873a3f93a877059b3067dfeb9874a5364513428..88519c591160ae35c8889c6a539b224bffe45b9c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,6 @@ stages: - build + build: stage: build script: @@ -7,3 +8,11 @@ build: - R CMD build --resave-data . - R CMD check --as-cran --no-manual --run-donttest CSIndicators_*.tar.gz - R -e 'covr::package_coverage()' + +lint-check: + stage: build + script: + - module load R/4.1.2-foss-2015a-bare + - module load CDO/1.9.8-foss-2015a + - echo "Run lintr on the package..." + - Rscript -e 'lintr::lint_package(path = ".")' diff --git a/.lintr b/.lintr new file mode 100644 index 0000000000000000000000000000000000000000..d56581da01dbf465e6799b8d027ede435e8e9ffb --- /dev/null +++ b/.lintr @@ -0,0 +1,22 @@ +linters: linters_with_tags( # lintr_3.1.1 + tags = c("package_development", "readability", "best_practices"), + line_length_linter = line_length_linter(100L), + T_and_F_symbol_linter = NULL, + quotes_linter = NULL, + commented_code_linter = NULL, + implicit_integer_linter = NULL, + vector_logic_linter = NULL, + extraction_operator_linter = NULL, + function_left_parentheses_linter = NULL, + semicolon_linter = NULL, + indentation_linter = NULL, + unnecessary_nested_if_linter = NULL, + if_not_else_linter = NULL, + object_length_linter = NULL, + infix_spaces_linter(exclude_operators = "~") + ) +exclusions: list( + "inst", + "tests/testthat/", + "tests/testthat.R" + )