Skip to content

Commit 126bb48

Browse files
committed
chore: update pre-commit hooks, add autoupdate workflow
1 parent 590ae05 commit 126bb48

3 files changed

Lines changed: 53 additions & 38 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 'Update pre-commit hooks'
2+
3+
on:
4+
schedule:
5+
- cron: '0 8 * * 1'
6+
workflow_dispatch: {}
7+
8+
permissions:
9+
contents: 'write'
10+
pull-requests: 'write'
11+
12+
jobs:
13+
update:
14+
runs-on: 'ubuntu-latest'
15+
steps:
16+
- name: 'Checkout repository'
17+
uses: 'actions/checkout@v4'
18+
19+
- name: 'Set up Python'
20+
uses: 'actions/setup-python@v5'
21+
with:
22+
python-version: '3.12'
23+
24+
- name: 'Install pre-commit'
25+
run: 'pip install pre-commit'
26+
27+
- name: 'Run pre-commit autoupdate'
28+
run: 'pre-commit autoupdate'
29+
30+
- name: 'Create Pull Request'
31+
uses: 'peter-evans/create-pull-request@v7'
32+
with:
33+
commit-message: 'chore: update pre-commit hooks'
34+
title: 'chore: update pre-commit hooks'
35+
body: 'Automatic pre-commit hook version update.'
36+
branch: 'chore/pre-commit-autoupdate'

.pre-commit-config.yaml

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,27 @@
1-
# See https://pre-commit.com for more information
2-
# See https://pre-commit.com/hooks.html for more hooks
3-
41
repos:
2+
- repo: 'https://github.com/adrienverge/yamllint'
3+
rev: 'v1.38.0'
4+
hooks:
5+
- id: 'yamllint'
6+
args: ['-c=.yamllint.yml']
7+
files: '\.(yaml|yml)$'
8+
types: ['file', 'yaml']
9+
entry: 'yamllint'
10+
511
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
6-
rev: 'v4.6.0'
12+
rev: 'v6.0.0'
713
hooks:
8-
- id: 'trailing-whitespace'
9-
- id: 'end-of-file-fixer'
1014
- id: 'check-added-large-files'
15+
- id: 'check-ast'
16+
- id: 'fix-byte-order-marker'
1117
- id: 'check-case-conflict'
1218
- id: 'check-executables-have-shebangs'
1319
- id: 'check-json'
20+
- id: 'check-merge-conflict'
1421
- id: 'check-yaml'
1522
args: ['--unsafe']
16-
- id: 'detect-private-key'
17-
- id: 'check-ast'
18-
- id: 'check-byte-order-marker'
19-
- id: 'check-merge-conflict'
2023
- id: 'debug-statements'
24+
- id: 'detect-private-key'
25+
- id: 'end-of-file-fixer'
2126
- id: 'mixed-line-ending'
22-
23-
# - repo: 'https://github.com/pycqa/isort'
24-
# rev: '5.10.1'
25-
# hooks:
26-
# - id: 'isort'
27-
28-
- repo: 'https://github.com/adrienverge/yamllint.git'
29-
rev: 'v1.35.1'
30-
hooks:
31-
- id: 'yamllint'
32-
args: ['-c=.yamllint.yml']
33-
files: '\.(yaml|yml)$'
34-
types: ['file', 'yaml']
35-
entry: 'yamllint'
36-
37-
# - repo: 'local'
38-
# hooks:
39-
# - id: 'pylint'
40-
# name: 'pylint'
41-
# entry: 'pylint'
42-
# language: 'system'
43-
# types: [python]
44-
# args:
45-
# [
46-
# "-rn", # Only display messages
47-
# "-sn", # Don't display the score
48-
# "--disable=C0103,C0114,C0116,C0301",
49-
# ]
27+
- id: 'trailing-whitespace'

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
### Changed
1414

15+
* Update pre-commit hooks to latest versions
1516
* Unify CONTRIBUTING and convert from reStructuredText to Markdown
1617

1718
### Breaking Changes

0 commit comments

Comments
 (0)