diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index 8886f2e45..fae6e5d35 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -2,8 +2,8 @@ name: pre-commit on: push: branches-ignore: - - 'master' - - 'main' + - "master" + - "main" pull_request: types: [opened, synchronize, reopened, ready_for_review] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dd21f73e7..de90831d5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,15 +2,16 @@ # R specific hooks: https://github.com/lorenzwalthert/precommit default_stages: [commit] default_language_version: - python: python3 + python: python3 repos: -- repo: https://github.com/lorenzwalthert/precommit + - repo: https://github.com/lorenzwalthert/precommit rev: v0.3.2.9003 hooks: - - id: style-files - args: ['--ignore-start="^# styler: off$"', '--ignore-stop="^# styler: on$"'] - exclude: > + - id: style-files + args: + ['--ignore-start="^# styler: off$"', '--ignore-stop="^# styler: on$"'] + exclude: > (?x)^( tests/testthat/.*/.*\.R(md|nw)?| vignettes/customizing_styler\.Rmd| @@ -19,13 +20,13 @@ repos: tests/testmanual/addins/.*invalid.*| tests/testmanual/addins/r-valid\.R| )$ - - id: roxygenize + - id: roxygenize additional_dependencies: - - r-lib/pkgapi - - dplyr@1.0.9 - - roxygen2@7.2.1 - - id: use-tidy-description - - id: spell-check + - r-lib/pkgapi + - dplyr@1.0.9 + - roxygen2@7.2.1 + - id: use-tidy-description + - id: spell-check exclude: > (?x)^( \.github/.*\.yaml| @@ -51,8 +52,8 @@ repos: .*\.RData| .*-in_tree )$ - - id: readme-rmd-rendered - - id: parsable-R + - id: readme-rmd-rendered + - id: parsable-R exclude: > (?x)^( tests/testthat/public-api/xyzaddin/addin_region-.*| @@ -65,7 +66,7 @@ repos: tests/testthat/public-api/xyzfile_rmd/random4\.Rmd| tests/testthat/rmd/no-tidy-(in|out)\.Rmd| )$ - - id: no-browser-statement + - id: no-browser-statement exclude: > (?x)^( tests/testthat/public-api/xyzaddin/addin_region-.*| @@ -76,7 +77,7 @@ repos: tests/testthat/exception_handling/parser-error.R| tests/testmanual/| )$ - - id: deps-in-desc + - id: deps-in-desc exclude: > (?x)^( touchstone/.*| @@ -85,14 +86,14 @@ repos: tests/testthat/rnw/011-conditional-eval-out\.Rnw| tests/testthat/.*\.R(md)? )$ -- repo: https://github.com/pre-commit/pre-commit-hooks + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: - - id: check-added-large-files - args: ['--maxkb=200'] - - id: file-contents-sorter + - id: check-added-large-files + args: ["--maxkb=200"] + - id: file-contents-sorter files: "\\.Rbuildignore$" - - id: end-of-file-fixer + - id: end-of-file-fixer exclude: > (?x)^( \.Rd| @@ -101,13 +102,13 @@ repos: tests/testthat/reference-objects/.*| tests/testthat/_snaps/.*| )$ -- repo: https://github.com/lorenzwalthert/gitignore-tidy + - repo: https://github.com/lorenzwalthert/gitignore-tidy rev: a2260df7cc08de00d7312aeff68cea6bcba48c42 hooks: - - id: tidy-gitignore -- repo: local + - id: tidy-gitignore + - repo: local hooks: - - id: forbid-to-commit + - id: forbid-to-commit name: Don't commit common R artifacts entry: Cannot commit .Rhistory, .RData, .Rds or .rds. language: fail