Skip to content

Commit fb50bf4

Browse files
author
github-actions
committed
Align pre-commit config with GitHub workflows
- Update Ruff hooks to run on both src/ and tests/ directories - Remove MyPy from pre-commit (covered by CI typecheck workflow) - Add check-merge-conflict and debug-statements hooks - Fix trailing whitespace and end-of-file issues
1 parent 0a942fb commit fb50bf4

File tree

5 files changed

+43
-47
lines changed

5 files changed

+43
-47
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
id: bump
5151
run: |
5252
BUMP_TYPE="${{ inputs.bump }}"
53-
53+
5454
# For alpha/beta/rc, we need to bump minor first if not already a prerelease
5555
if [[ "$BUMP_TYPE" =~ ^(alpha|beta|rc)$ ]]; then
5656
CURRENT_VERSION=$(uv version --short)
@@ -62,12 +62,12 @@ jobs:
6262
else
6363
uv version --bump "$BUMP_TYPE"
6464
fi
65-
65+
6666
# Get the new version
6767
NEW_VERSION=$(uv version --short)
6868
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
6969
echo "New version: $NEW_VERSION"
70-
70+
7171
# Check if it's a prerelease version
7272
if [[ "$NEW_VERSION" =~ (a|b|rc)[0-9]+ ]]; then
7373
echo "is_prerelease=true" >> $GITHUB_OUTPUT

.github/workflows/version-check.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ jobs:
3333
# Get version from pyproject.toml
3434
PYPROJECT_VERSION=$(uv version | awk '{print $2}')
3535
echo "pyproject.toml version: $PYPROJECT_VERSION"
36-
36+
3737
# Get version from __init__.py (match only the assignment line, not __all__)
3838
INIT_VERSION=$(grep -E '^__version__ = ' src/ryandata_address_utils/__init__.py | sed 's/__version__ = "\(.*\)"/\1/')
3939
echo "__init__.py version: $INIT_VERSION"
40-
40+
4141
# Compare versions
4242
if [ "$PYPROJECT_VERSION" != "$INIT_VERSION" ]; then
4343
echo "❌ Version mismatch!"
4444
exit 1
4545
fi
46-
46+
4747
echo "✅ Versions are in sync: $PYPROJECT_VERSION"
4848
echo "version=$PYPROJECT_VERSION" >> $GITHUB_OUTPUT
4949
@@ -71,17 +71,17 @@ jobs:
7171
run: |
7272
VERSION="${{ needs.check-version-sync.outputs.version }}"
7373
echo "VERSION: '$VERSION'"
74-
74+
7575
if [ -z "$VERSION" ]; then
7676
echo "ERROR: VERSION is empty!"
7777
exit 1
7878
fi
79-
79+
8080
TAG_NAME="v$VERSION"
8181
echo "Checking for tag: $TAG_NAME"
8282
echo "Existing tags:"
8383
git tag -l
84-
84+
8585
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
8686
echo "Tag $TAG_NAME exists locally"
8787
echo "created=false" >> $GITHUB_OUTPUT

.pre-commit-config.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,13 @@ repos:
66
- id: end-of-file-fixer
77
- id: check-yaml
88
- id: check-added-large-files
9+
- id: check-merge-conflict
10+
- id: debug-statements
911

1012
- repo: https://github.com/astral-sh/ruff-pre-commit
1113
rev: v0.11.0
1214
hooks:
1315
- id: ruff
14-
args: [--fix]
16+
args: [--fix, src/, tests/]
1517
- id: ruff-format
16-
17-
- repo: https://github.com/pre-commit/mirrors-mypy
18-
rev: v1.13.0
19-
hooks:
20-
- id: mypy
21-
additional_dependencies: [
22-
'pydantic>=2.0.0',
23-
'types-requests',
24-
'typing-extensions'
25-
]
26-
args: [--ignore-missing-imports]
18+
args: [src/, tests/]

context7.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"url": "https://context7.com/abstract-data/ryandata-address-utils",
3+
"public_key": "pk_8ETvPdpkJ4NIPNS2lpXxA"
4+
}

uv.lock

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)