Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pre-commit #18

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Commands

jobs:
document:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') || github.event.comment.author_association == 'CONTRIBUTOR') && startsWith(github.event.comment.body, '/document') }}
name: document
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -45,7 +45,7 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}

style:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') || github.event.comment.author_association == 'CONTRIBUTOR') && startsWith(github.event.comment.body, '/style') }}
name: style
runs-on: ubuntu-latest
env:
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/pre-commit.yaml

This file was deleted.

60 changes: 56 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,33 @@ repos:
rev: v0.4.3
hooks:
- id: style-files
args: [--style_pkg=styler, --style_fun=tidyverse_style]
args: [--style_pkg=styler, --style_fun=tidyverse_style,
--cache-root=styler-perm]
- id: roxygenize
- 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
rev: v4.6.0
hooks:
hooks:
- id: check-added-large-files
args: ['--maxkb=200']
- id: file-contents-sorter
files: '^\.Rbuildignore$'
- id: end-of-file-fixer
exclude: '\.Rd'
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
rev: v1.6.1
hooks:
Expand All @@ -38,6 +47,40 @@ repos:
files: '\.(Rhistory|RData|Rds|rds)$'
# `exclude: <regex>` to allow committing specific files
#####
# Python
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
# 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
args: ['--profile', 'black',
'--line-length', '79']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.2
hooks:
- id: ruff
#####
# Java
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.13.0
hooks:
- id: pretty-format-java
args: [--aosp,--autofix]
#####
# Julia
# Due to lack of first-class Julia support, this needs Julia local install
# and JuliaFormatter.jl installed in the library
# - repo: https://github.com/domluna/JuliaFormatter.jl
# rev: v1.0.39
# hooks:
# - id: julia-formatter
#####
# Secrets
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
Expand All @@ -46,4 +89,13 @@ repos:
args: ['--baseline', '.secrets.baseline']
exclude: package.lock.json
ci:
autoupdate_schedule: monthly
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
skip: [roxygenize]
submodules: false
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Description: Add logging, metadata handling, and data handling
License: Apache License (>= 2)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.1
Suggests:
testthat (>= 3.0.0),
withr
Config/testthat/edition: 3
Imports:
Imports:
AzureRMR,
AzureStor,
cli,
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# CFAEpiNow2Pipeline (development version)

* Updated, faster pre-commit checks
* Azure Blob file download utilities
* CI running on Ubuntu only & working pkgdown deploy to Github Pages
* Initial R package with checks running in CI
Expand Down
2 changes: 2 additions & 0 deletions R/add.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#' A temp function
#'
#' Adding some meaningless text to test rendering via PR command.
#'
#' @param x A number
#' @param y Another number
#' @return Their sum
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Overview

A lightweight wrapper around [{EpiNow2}](https://github.com/epiforecasts/EpiNow2) to add functionality for deployment in Azure Batch.
It holds some helper functions to interface with Azure services, convert input data to EpiNow2's expected input format, and save expected outputs.
It holds some helper functions to interface with Azure services, convert input data to EpiNow2's expected input format, and save expected outputs.
It also adds metadata and logging.

This package is meant to enhance the `{EpiNow2}` package to support deployment in CFA's computational environment.
Expand Down
8 changes: 4 additions & 4 deletions man/fetch_blob_container.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading