From cf5b6a8330bfe53694fcc41769c8777c23bb4d12 Mon Sep 17 00:00:00 2001 From: Justin Bousquin Date: Wed, 4 Mar 2026 17:16:28 -0600 Subject: [PATCH 1/4] Add pre-commit configuration for air-format hook --- .pre-commit-config.yaml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..3069fb91d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,7 @@ +repos: + - repo: https://github.com/posit-dev/air-pre-commit + # Air version + rev: 0.8.2 + hooks: + # Run the formatter + - id: air-format From 8d630f1c4f9f17381d9900e0e808bac4aa0a381e Mon Sep 17 00:00:00 2001 From: Justin Bousquin Date: Wed, 4 Mar 2026 17:31:09 -0600 Subject: [PATCH 2/4] Rename and update format workflow configuration Change from suggests to pre-commit --- .github/workflows/format-suggest.yaml | 46 ------------------------- .github/workflows/format_pre-commit.yml | 33 ++++++++++++++++++ 2 files changed, 33 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/format-suggest.yaml create mode 100644 .github/workflows/format_pre-commit.yml diff --git a/.github/workflows/format-suggest.yaml b/.github/workflows/format-suggest.yaml deleted file mode 100644 index af5021001..000000000 --- a/.github/workflows/format-suggest.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Workflow derived from https://github.com/posit-dev/setup-air/tree/main/examples - -on: - # Using `pull_request_target` over `pull_request` for elevated `GITHUB_TOKEN` - # privileges, otherwise we can't set `pull-requests: write` when the pull - # request comes from a fork, which is our main use case (external contributors). - # - # `pull_request_target` runs in the context of the target branch (`main`, usually), - # rather than in the context of the pull request like `pull_request` does. Due - # to this, we must explicitly checkout `ref: ${{ github.event.pull_request.head.sha }}`. - # This is typically frowned upon by GitHub, as it exposes you to potentially running - # untrusted code in a context where you have elevated privileges, but they explicitly - # call out the use case of reformatting and committing back / commenting on the PR - # as a situation that should be safe (because we aren't actually running the untrusted - # code, we are just treating it as passive data). - # https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/ - pull_request_target: - -name: format-suggest.yaml - -jobs: - format-suggest: - name: format-suggest - runs-on: ubuntu-latest - - permissions: - # Required to push suggestion comments to the PR - pull-requests: write - - steps: - - uses: actions/checkout@v6 - with: - ref: ${{ github.event.pull_request.head.sha }} - - - name: Install - uses: posit-dev/setup-air@v1 - - - name: Format - run: air format . - - - name: Suggest - uses: reviewdog/action-suggester@v1 - with: - level: error - fail_level: error - tool_name: air diff --git a/.github/workflows/format_pre-commit.yml b/.github/workflows/format_pre-commit.yml new file mode 100644 index 000000000..7e7bd25f7 --- /dev/null +++ b/.github/workflows/format_pre-commit.yml @@ -0,0 +1,33 @@ +# Workflow derived from https://github.com/posit-dev/setup-air/tree/main/examples +name: format +on: + pull_request: + workflow_dispatch: # allows you to trigger manually + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + format-pre-commit: + name: format-update + runs-on: ubuntu-latest + + permissions: + contents: write + pull-requests: write + + steps: + - uses: actions/checkout@v6 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: format + uses: pre-commit/action@v3.0.1 + continue-on-error: true + + - name: commit & push + run: | + git add . + git commit -m "ci: 🤖 auto-format" || echo "nothing to commit" + git push || echo "nothing to push" From eef91c4c7f1dfc53811c44e8e6658f239b6c86b2 Mon Sep 17 00:00:00 2001 From: Justin Bousquin Date: Wed, 4 Mar 2026 17:33:59 -0600 Subject: [PATCH 3/4] Add nothing_var to re-format --- R/GeospatialFunctions.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/GeospatialFunctions.R b/R/GeospatialFunctions.R index 87ce8955e..8a2324fae 100644 --- a/R/GeospatialFunctions.R +++ b/R/GeospatialFunctions.R @@ -226,6 +226,9 @@ fetchATTAINS <- function(.data, catchments_only = FALSE, org_id = "all") { ) } + # Nothing comment + nothing_var <- c("https://gispub.epa.gov/arcgis/1", "https://gispub.epa.gov/arcgis/2", "https://gispub.epa.gov/arcgis/3") + baseurls <- c( "https://gispub.epa.gov/arcgis/rest/services/OW/ATTAINS_Assessment/MapServer/3/query?", "https://gispub.epa.gov/arcgis/rest/services/OW/ATTAINS_Assessment/MapServer/0/query?", From 4fed28410bba3ce9be37949b57e7284b5fc3d02d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 23:34:28 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- R/GeospatialFunctions.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/GeospatialFunctions.R b/R/GeospatialFunctions.R index 8a2324fae..8dcc083be 100644 --- a/R/GeospatialFunctions.R +++ b/R/GeospatialFunctions.R @@ -227,7 +227,11 @@ fetchATTAINS <- function(.data, catchments_only = FALSE, org_id = "all") { } # Nothing comment - nothing_var <- c("https://gispub.epa.gov/arcgis/1", "https://gispub.epa.gov/arcgis/2", "https://gispub.epa.gov/arcgis/3") + nothing_var <- c( + "https://gispub.epa.gov/arcgis/1", + "https://gispub.epa.gov/arcgis/2", + "https://gispub.epa.gov/arcgis/3" + ) baseurls <- c( "https://gispub.epa.gov/arcgis/rest/services/OW/ATTAINS_Assessment/MapServer/3/query?",