Skip to content

Commit

Permalink
Use .pre-commit.config.yaml from main
Browse files Browse the repository at this point in the history
To fix weirdness with unicode parsing error from.....somewhere?
  • Loading branch information
zsusswein committed Oct 1, 2024
1 parent 6b078b2 commit 8161d43
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 51 deletions.
95 changes: 45 additions & 50 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,56 @@ repos:
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.4.3.9001
hooks:
- id: style-files
args:
[
--style_pkg=styler,
--style_fun=tidyverse_style,
--cache-root=styler-perm,
]
- id: use-tidy-description
- id: lintr
- id: readme-rmd-rendered
- id: parsable-R
- id: no-browser-statement
- id: no-print-statement
- id: style-files
args: [--style_pkg=styler, --style_fun=tidyverse_style,
--cache-root=styler-perm]
- id: use-tidy-description
- id: lintr
- id: readme-rmd-rendered
- id: parsable-R
- id: no-browser-statement
- id: no-print-statement
exclude: '^tests/testthat/test-print\.R$'
- id: no-debug-statement
- id: deps-in-desc
- repo: https://github.com/pre-commit/pre-commit-hooks
- id: no-debug-statement
- id: deps-in-desc
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
args: ["--maxkb=200"]
exclude: "tests/testthat/data/sample_fit.RDS"
- 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: '(\.Rd)|(tests/testthat/_snaps/)'
- id: check-yaml
- id: check-toml
- id: mixed-line-ending
args: ["--fix=lf"]
- id: trailing-whitespace
exclude: "tests/testthat/_snaps/"
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config
- id: check-yaml
- id: check-toml
- id: mixed-line-ending
args: ['--fix=lf']
- id: trailing-whitespace
exclude: 'tests/testthat/_snaps/'
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config
rev: v1.6.1
hooks:
# Only required when https://pre-commit.ci is used for config validation
- id: check-pre-commit-ci-config
- repo: local
# Only required when https://pre-commit.ci is used for config validation
- id: check-pre-commit-ci-config
- 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
files: '\.(Rhistory|RData|Rds|rds)$'
# `exclude: <regex>` to allow committing specific files
#####
# Python
- repo: https://github.com/psf/black
#####
# Python
- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
# if you have ipython notebooks, consider using
# `black-jupyter` hook instead
- id: black
args: ["--line-length", "79"]
- repo: https://github.com/PyCQA/isort
# if you have ipython notebooks, consider using
# `black-jupyter` hook instead
- id: black
args: ['--line-length', '79']
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
Expand Down Expand Up @@ -89,16 +84,16 @@ repos:
- repo: https://github.com/Yelp/detect-secrets
rev: v1.5.0
hooks:
- id: detect-secrets
args: ["--baseline", ".secrets.baseline"]
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: package.lock.json
ci:
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
autofix_commit_msg: |
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ""
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: weekly
submodules: false
for more information, see https://pre-commit.ci
autofix_prs: true
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
submodules: false
6 changes: 5 additions & 1 deletion R/write_output.R
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ write_parquet <- function(data, path) {
# ephemeral from a temporary in-memory DB. There's no actual database to
# guard against a SQL injection attack and all the data are already available
# here.
query <- paste0("COPY (SELECT * FROM df) TO '", path, "' (FORMAT PARQUET, CODEC 'zstd')")
query <- paste0(
"COPY (SELECT * FROM df) TO '",
path,
"' (FORMAT PARQUET, CODEC 'zstd')"
)
con <- DBI::dbConnect(duckdb::duckdb())
on.exit(expr = DBI::dbDisconnect(con))

Expand Down

0 comments on commit 8161d43

Please sign in to comment.