From e99e585ad3f922ca887dbd63ceda3febd3f4adda Mon Sep 17 00:00:00 2001 From: Jan Marvin Garbuszus Date: Thu, 4 Feb 2021 23:41:08 +0100 Subject: [PATCH 1/4] nolint --- inst/extdata/build_font_size_lookup.R | 2 +- inst/extdata/conditional_formatting_testing.R | 4 +++- inst/extdata/load_xlsx_testing.R | 4 ++-- inst/extdata/stack_style_testing.R | 19 ++----------------- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/inst/extdata/build_font_size_lookup.R b/inst/extdata/build_font_size_lookup.R index ffbe1f7d..071f7cac 100644 --- a/inst/extdata/build_font_size_lookup.R +++ b/inst/extdata/build_font_size_lookup.R @@ -61,4 +61,4 @@ cat(allStrs) -# nolint end \ No newline at end of file +# nolint end diff --git a/inst/extdata/conditional_formatting_testing.R b/inst/extdata/conditional_formatting_testing.R index 76ecf450..b95d3510 100644 --- a/inst/extdata/conditional_formatting_testing.R +++ b/inst/extdata/conditional_formatting_testing.R @@ -1,4 +1,4 @@ - +# nolint start wb <- createWorkbook() @@ -76,3 +76,5 @@ wb <- loadWorkbook(fl) conditionalFormatting(wb, "Duplicates", cols = 1, rows = 1:10, type = "duplicates", style = createStyle(textDecoration = 'BOLD')) openXL(wb) + +# nolint end diff --git a/inst/extdata/load_xlsx_testing.R b/inst/extdata/load_xlsx_testing.R index 36a8a43f..9a47b30e 100644 --- a/inst/extdata/load_xlsx_testing.R +++ b/inst/extdata/load_xlsx_testing.R @@ -1,4 +1,4 @@ - +# nolint start require('openxlsx') unzip_xlsx <- function(fl){ @@ -172,4 +172,4 @@ openXL(file.path(test_file_dir, "pivotTest.xlsx")) - +# nolint end diff --git a/inst/extdata/stack_style_testing.R b/inst/extdata/stack_style_testing.R index f60ad6d5..eb5d2ca4 100644 --- a/inst/extdata/stack_style_testing.R +++ b/inst/extdata/stack_style_testing.R @@ -1,4 +1,4 @@ - +# nolint start require('openxlsx') @@ -123,19 +123,4 @@ addStyle(wb, 3, createStyle(textDecoration = "bold", fgFill = "salmon"), 2:4, 2: openXL(wb) - - - - - - - - - - - - - - - - +# nolint end From a0615c04a680b60751011def71420414000cdfdb Mon Sep 17 00:00:00 2001 From: Jan Marvin Garbuszus Date: Fri, 2 Apr 2021 17:56:54 +0200 Subject: [PATCH 2/4] add lintr config --- .lintr | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .lintr diff --git a/.lintr b/.lintr new file mode 100644 index 00000000..3c9ce715 --- /dev/null +++ b/.lintr @@ -0,0 +1,18 @@ +linters: with_defaults( + line_length_linter = NULL, # we have many long lines + cyclocomp_linter = NULL, # + commented_code_linter = NULL, # + snake_case_linter = NULL, # we prefered camel case + trailing_whitespace_linter = NULL, # have a few cases + commas_linter = NULL, # + paren_brace_linter = NULL, # + object_name_linter = NULL, # more camel case + infix_spaces_linter = NULL, # + function_left_parentheses_linter = NULL, # + spaces_inside_linter = NULL, # + spaces_left_parentheses_linter = NULL, # + no_tab_linter = NULL, # + single_quotes_linter = NULL, # + object_length_linter = NULL, # + assignment_linter = NULL # just one case + ) From 74fbe19a7e145b6083dfceb0343bd7942e71b84b Mon Sep 17 00:00:00 2001 From: Jan Marvin Garbuszus Date: Fri, 2 Apr 2021 19:42:01 +0200 Subject: [PATCH 3/4] add to .Rbuildignore --- .Rbuildignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.Rbuildignore b/.Rbuildignore index 93930e7c..e32b748f 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -5,6 +5,7 @@ cran-comments.md ^.*\.github\* .travis.yml .appveyor.yml +.lintr ^cran-comments\.md$ ^CRAN-RELEASE$ ^_pkgdown\.yml$ From 9f0da2517d1b552f4167748f2337e37e87b5ea2a Mon Sep 17 00:00:00 2001 From: Jan Marvin Garbuszus Date: Fri, 2 Apr 2021 19:42:48 +0200 Subject: [PATCH 4/4] update from https://github.com/r-lib/actions/tree/master/examples#lint-workflow --- .github/workflows/lint.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 36a22376..cf0385fb 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,9 +1,11 @@ on: push: branches: + - main - master pull_request: branches: + - main - master name: lint @@ -16,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: r-lib/actions/setup-r@master + - uses: r-lib/actions/setup-r@v1 - name: Query dependencies run: | @@ -25,8 +27,8 @@ jobs: writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") shell: Rscript {0} - - name: Cache R packages - uses: actions/cache@v1 + - name: Restore R package cache + uses: actions/cache@v2 with: path: ${{ env.R_LIBS_USER }} key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} @@ -39,6 +41,9 @@ jobs: remotes::install_cran("lintr") shell: Rscript {0} + - name: Install package + run: R CMD INSTALL . + - name: Lint run: lintr::lint_package() shell: Rscript {0}