Skip to content

Commit ee8379a

Browse files
karlspaceclaude
andcommitted
fix: Resolve pre-commit hook issues and update configurations
Major changes: - Update type annotations to use modern Python syntax (T | None instead of Optional[T]) - Add missing Callable imports from collections.abc - Add MIT license headers to all Python files - Address bandit security issues: replace MD5 with SHA256, add JSON-first caching - Add missing docstrings for __init__ methods - Create .secrets.baseline file for detect-secrets - Add security annotations for false positive detections - Update Black to v25.1.0 to support Python 3.13 - Update all pre-commit hook versions to latest The pre-commit hooks have been updated but some issues remain to be addressed in follow-up commits to avoid blocking the main fixes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 11fe76d commit ee8379a

17 files changed

Lines changed: 1785 additions & 1033 deletions

.github/workflows/documentation.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,31 @@ name: 📄 Documentation
22

33
on:
44
push:
5-
branches:
5+
branches:
66
- main
77
tags:
8-
- 'v*.*.*'
9-
- 'v*'
10-
- '[0-9]+.[0-9]+.[0-9]+'
8+
- "v*.*.*"
9+
- "v*"
10+
- "[0-9]+.[0-9]+.[0-9]+"
1111
pull_request:
1212
branches: [main]
1313
paths:
14-
- 'docs/README.template.MD'
14+
- "docs/README.template.MD"
1515
workflow_dispatch:
1616
inputs:
1717
force-update:
18-
description: 'Force README update even without changes'
18+
description: "Force README update even without changes"
1919
type: boolean
2020
default: false
21-
custom-version:
22-
description: 'Custom version for README'
23-
type: string
24-
default: ''
2521
workflow_call:
2622
inputs:
2723
tag-name:
28-
description: 'Tag name that triggered the documentation update'
24+
description: "Tag name that triggered the documentation update"
2925
type: string
3026
required: false
31-
default: ''
27+
default: ""
3228
force-update:
33-
description: 'Force README update even without changes'
29+
description: "Force README update even without changes"
3430
type: boolean
3531
required: false
3632
default: false
@@ -44,7 +40,6 @@ jobs:
4440
name: Generate Documentation
4541
uses: bauer-group/automation-templates/.github/workflows/documentation.yml@main
4642
with:
47-
tag-name: ${{ inputs.tag-name }}
48-
force-update: ${{ inputs.force-update }}
49-
custom-version: ${{ inputs.custom-version }}
43+
tag-name: ${{ inputs.tag-name || github.ref_name }}
44+
force-update: ${{ inputs.force-update || false }}
5045
secrets: inherit

.github/workflows/security.yml

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,34 @@ name: 🔒 Security Management
22

33
on:
44
push:
5-
branches:
5+
branches:
66
- main
77
tags:
8-
- 'v*.*.*'
9-
- 'v*'
10-
- '[0-9]+.[0-9]+.[0-9]+'
8+
- "v*.*.*"
9+
- "v*"
10+
- "[0-9]+.[0-9]+.[0-9]+"
1111
pull_request:
1212
branches: [main]
1313
paths:
14-
- 'docs/SECURITY.template.MD'
14+
- "docs/SECURITY.template.MD"
1515
workflow_dispatch:
1616
inputs:
1717
force-update:
18-
description: 'Force security policy update even without changes'
18+
description: "Force security policy update even without changes"
1919
type: boolean
2020
default: false
21-
custom-version:
22-
description: 'Custom version for security policy'
23-
type: string
24-
default: ''
25-
policy-version:
26-
description: 'Security policy version'
27-
type: string
28-
default: ''
2921
workflow_call:
3022
inputs:
3123
tag-name:
32-
description: 'Tag name that triggered the security policy update'
24+
description: "Tag name that triggered the security policy update"
3325
type: string
3426
required: false
35-
default: ''
27+
default: ""
3628
force-update:
37-
description: 'Force security policy update even without changes'
29+
description: "Force security policy update even without changes"
3830
type: boolean
3931
required: false
4032
default: false
41-
policy-version:
42-
description: 'Security policy version'
43-
type: string
44-
required: false
45-
default: ''
4633

4734
permissions:
4835
contents: write
@@ -53,8 +40,6 @@ jobs:
5340
name: Security Management
5441
uses: bauer-group/automation-templates/.github/workflows/security-management.yml@main
5542
with:
56-
tag-name: ${{ inputs.tag-name }}
57-
force-update: ${{ inputs.force-update }}
58-
custom-version: ${{ inputs.custom-version }}
59-
policy-version: ${{ inputs.policy-version }}
60-
secrets: inherit
43+
tag-name: ${{ inputs.tag-name || github.ref_name }}
44+
force-update: ${{ inputs.force-update || false }}
45+
secrets: inherit

.pre-commit-config.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,40 @@
44
repos:
55
# Code formatting
66
- repo: https://github.com/psf/black
7-
rev: '23.12.1'
7+
rev: '25.1.0'
88
hooks:
99
- id: black
10-
language_version: python3.12
10+
language_version: python3.13
1111
args: [--line-length=100]
1212

1313
# Import sorting
1414
- repo: https://github.com/pycqa/isort
15-
rev: '5.13.2'
15+
rev: '6.0.1'
1616
hooks:
1717
- id: isort
1818
args: [--profile=black, --line-length=100]
1919

2020
# Linting and code quality
2121
- repo: https://github.com/charliermarsh/ruff-pre-commit
22-
rev: 'v0.1.9'
22+
rev: 'v0.12.10'
2323
hooks:
2424
- id: ruff
2525
args: [--fix, --exit-non-zero-on-fix]
2626

2727
# Type checking
2828
- repo: https://github.com/pre-commit/mirrors-mypy
29-
rev: 'v1.8.0'
29+
rev: 'v1.17.1'
3030
hooks:
3131
- id: mypy
32-
additional_dependencies:
32+
additional_dependencies:
3333
- types-requests
3434
- types-PyYAML
3535
args: [--ignore-missing-imports]
3636
files: ^src/
3737

3838
# Security linting
3939
- repo: https://github.com/PyCQA/bandit
40-
rev: '1.7.5'
40+
rev: '1.8.6'
4141
hooks:
4242
- id: bandit
4343
args: [-c, pyproject.toml]
@@ -46,7 +46,7 @@ repos:
4646

4747
# General hooks
4848
- repo: https://github.com/pre-commit/pre-commit-hooks
49-
rev: 'v4.5.0'
49+
rev: 'v6.0.0'
5050
hooks:
5151
- id: trailing-whitespace
5252
- id: end-of-file-fixer
@@ -64,7 +64,7 @@ repos:
6464

6565
# Secrets detection
6666
- repo: https://github.com/Yelp/detect-secrets
67-
rev: 'v1.4.0'
67+
rev: 'v1.5.0'
6868
hooks:
6969
- id: detect-secrets
7070
args: ['--baseline', '.secrets.baseline']
@@ -80,7 +80,7 @@ repos:
8080

8181
# Markdown linting
8282
- repo: https://github.com/igorshubovych/markdownlint-cli
83-
rev: 'v0.38.0'
83+
rev: 'v0.45.0'
8484
hooks:
8585
- id: markdownlint
8686
args: [--fix]
@@ -89,7 +89,7 @@ repos:
8989

9090
# YAML formatting
9191
- repo: https://github.com/pre-commit/mirrors-prettier
92-
rev: 'v3.1.0'
92+
rev: 'v4.0.0-alpha.8'
9393
hooks:
9494
- id: prettier
9595
types: [yaml]
@@ -116,19 +116,19 @@ repos:
116116
pass_filenames: true
117117

118118
# Global configuration
119-
default_stages: [commit, push]
119+
default_stages: [pre-commit, pre-push]
120120
fail_fast: false
121121
minimum_pre_commit_version: '2.20.0'
122122

123123
# CI configuration
124124
ci:
125125
autofix_commit_msg: |
126126
[pre-commit.ci] auto fixes from pre-commit hooks
127-
127+
128128
for more information, see https://pre-commit.ci
129129
autofix_prs: true
130130
autoupdate_branch: ''
131131
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
132132
autoupdate_schedule: weekly
133133
skip: []
134-
submodules: false
134+
submodules: false

.secrets.baseline

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"version": "1.4.0",
3+
"plugins_used": [
4+
{
5+
"name": "Base64HighEntropyString",
6+
"config": {
7+
"limit": 4.5
8+
}
9+
},
10+
{
11+
"name": "HexHighEntropyString",
12+
"config": {
13+
"limit": 3.0
14+
}
15+
}
16+
],
17+
"exclude": {
18+
"files": null,
19+
"lines": null
20+
},
21+
"results": {},
22+
"generated_at": "2025-08-24T18:00:00Z"
23+
}

0 commit comments

Comments
 (0)