Skip to content

Commit 3a073a8

Browse files
authored
Merge pull request #1152 from EnergySystemsModellingLab/bump-broken-pre-commit-hooks
Update `pre-commit` hooks and add workflow to auto-update them in future
2 parents 5117ccd + 29d8118 commit 3a073a8

12 files changed

+59
-21
lines changed

.github/workflows/auto-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Enable auto-merge for bot PRs
1616
run: |
1717
gh pr review --approve "$PR_URL"
18-
gh pr merge --auto --merge "$PR_URL"
18+
gh pr merge --auto --rebase "$PR_URL"
1919
env:
2020
PR_URL: ${{github.event.pull_request.html_url}}
2121
# GitHub provides this variable in the CI env. You don't
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Pre-commit auto-update
2+
3+
on:
4+
schedule:
5+
- cron: 0 0 * * 1 # midnight every Monday
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
auto-update:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
with:
18+
persist-credentials: false
19+
- uses: actions/setup-python@v5
20+
- uses: browniebroke/pre-commit-autoupdate-action@1
21+
- uses: peter-evans/create-pull-request@v7
22+
with:
23+
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
24+
branch: update/pre-commit-hooks
25+
title: Update pre-commit hooks
26+
commit-message: "chore: update pre-commit hooks"
27+
body: Update versions of pre-commit hooks to latest version.

.pre-commit-config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
exclude: ^schemas/table-schema.json$
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.5.0
4+
rev: v6.0.0
55
hooks:
66
- id: check-merge-conflict
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
99
- repo: https://github.com/python-jsonschema/check-jsonschema
10-
rev: 0.33.2
10+
rev: 0.37.0
1111
hooks:
1212
- id: check-dependabot
1313
- id: check-github-actions
@@ -31,16 +31,16 @@ repos:
3131
files: /settings\.toml$
3232
types_or: [toml]
3333
- repo: https://github.com/igorshubovych/markdownlint-cli
34-
rev: v0.38.0
34+
rev: v0.47.0
3535
hooks:
3636
- id: markdownlint-fix
3737
- repo: https://github.com/pre-commit/mirrors-prettier
38-
rev: "v3.1.0"
38+
rev: "v4.0.0-alpha.8"
3939
hooks:
4040
- id: prettier
4141
types_or: [yaml, json]
4242
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
43-
rev: v2.13.0
43+
rev: v2.16.0
4444
hooks:
4545
- id: pretty-format-toml
4646
args: [--autofix, --indent, "4", --no-sort]
@@ -53,19 +53,19 @@ repos:
5353
- id: clippy
5454
args: ["--all-targets", "--", "-D", "warnings"]
5555
- repo: https://github.com/astral-sh/ruff-pre-commit
56-
rev: v0.11.6
56+
rev: v0.15.4
5757
hooks:
58-
- id: ruff
58+
- id: ruff-check
5959
types_or: [python]
6060
args: [--fix]
6161
- id: ruff-format
6262
types_or: [python]
6363
- repo: https://github.com/kynan/nbstripout
64-
rev: 0.8.1
64+
rev: 0.9.1
6565
hooks:
6666
- id: nbstripout
6767
- repo: https://github.com/codespell-project/codespell
68-
rev: v2.2.6
68+
rev: v2.4.1
6969
hooks:
7070
- id: codespell
7171
args: [--ignore-words, .codespell_ignore.txt]

schemas/input/agent_commodity_portions.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ fields:
2020
- name: years
2121
type: string
2222
description: The year(s) to which this entry applies
23-
notes: One or more milestone years separated by semicolons, `all` to select all years or a year
23+
notes:
24+
One or more milestone years separated by semicolons, `all` to select all years or a year
2425
range in the form 'start..end' to select all valid years within range, inclusive. Either 'start'
2526
'end' or both can be omitted, which will set the corresponding limit to the minimum or maximum
2627
valid year, respectively.

schemas/input/agent_objectives.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ fields:
1616
- name: years
1717
type: string
1818
description: The year(s) to which this entry applies
19-
notes: One or more milestone years separated by semicolons, `all` to select all years or a year
19+
notes:
20+
One or more milestone years separated by semicolons, `all` to select all years or a year
2021
range in the form 'start..end' to select all valid years within range, inclusive. Either 'start'
2122
'end' or both can be omitted, which will set the corresponding limit to the minimum or maximum
2223
valid year, respectively.

schemas/input/agent_search_space.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ fields:
1616
- name: years
1717
type: string
1818
description: The year(s) to which this entry applies
19-
notes: One or more milestone years separated by semicolons, `all` to select all years or a year
19+
notes:
20+
One or more milestone years separated by semicolons, `all` to select all years or a year
2021
range in the form 'start..end' to select all valid years within range, inclusive. Either 'start'
2122
'end' or both can be omitted, which will set the corresponding limit to the minimum or maximum
2223
valid year, respectively.

schemas/input/commodity_levies.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ fields:
2020
- name: years
2121
type: string
2222
description: The year(s) to which this entry applies
23-
notes: One or more milestone years separated by semicolons, `all` to select all years or a year
23+
notes:
24+
One or more milestone years separated by semicolons, `all` to select all years or a year
2425
range in the form 'start..end' to select all valid years within range, inclusive. Either 'start'
2526
'end' or both can be omitted, which will set the corresponding limit to the minimum or maximum
2627
valid year, respectively.

schemas/input/demand.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ fields:
1717
- name: year
1818
type: string
1919
description: The year(s) to which this entry applies
20-
notes: One or more milestone years separated by semicolons, `all` to select all years or a year
20+
notes:
21+
One or more milestone years separated by semicolons, `all` to select all years or a year
2122
range in the form 'start..end' to select all valid years within range, inclusive. Either 'start'
2223
'end' or both can be omitted, which will set the corresponding limit to the minimum or maximum
2324
valid year, respectively.

schemas/input/process_availabilities.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ fields:
2222
- name: years
2323
type: string
2424
description: The milestone year(s) to which this entry applies
25-
notes: One or more milestone years separated by semicolons, `all` to select all years or a year
25+
notes:
26+
One or more milestone years separated by semicolons, `all` to select all years or a year
2627
range in the form 'start..end' to select all valid years within range, inclusive. Either 'start'
2728
'end' or both can be omitted, which will set the corresponding limit to the minimum or maximum
2829
valid year, respectively.

schemas/input/process_flows.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ fields:
2323
- name: years
2424
type: string
2525
description: The year(s) to which this entry applies
26-
notes: One or more milestone years separated by semicolons, `all` to select all years or a year
26+
notes:
27+
One or more milestone years separated by semicolons, `all` to select all years or a year
2728
range in the form 'start..end' to select all valid years within range, inclusive. Either 'start'
2829
'end' or both can be omitted, which will set the corresponding limit to the minimum or maximum
2930
valid year, respectively.

0 commit comments

Comments
 (0)