Skip to content

Commit 11b60e3

Browse files
committed
fix: fix black and ruff
1 parent 1c2bc07 commit 11b60e3

31 files changed

+536
-538
lines changed

.github/workflows/code-coverage.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,52 +10,52 @@ on:
1010
# Add permissions block here
1111
permissions:
1212
contents: write # Needed to update the README.md file
13-
13+
1414
jobs:
1515
coverage:
1616
runs-on: ubuntu-latest
17-
17+
1818
steps:
1919
- uses: actions/checkout@v4
20-
20+
2121
- name: Set up Python
2222
uses: actions/setup-python@v5
2323
with:
2424
python-version: "3.12"
25-
25+
2626
- name: Install Poetry
2727
run: |
2828
curl -sSL https://install.python-poetry.org | python3 -
2929
echo "$HOME/.local/bin" >> $GITHUB_PATH
30-
30+
3131
- name: Install dependencies
3232
run: |
3333
poetry install
34-
34+
3535
- name: Run tests with coverage
3636
run: |
3737
poetry run pytest --cov=my_python_package --cov-report=xml --cov-report=term
38-
38+
3939
- name: Upload coverage to Codecov
4040
uses: codecov/codecov-action@v4
4141
with:
4242
file: ./coverage.xml
4343
fail_ci_if_error: false
4444
token: ${{ secrets.CODECOV_TOKEN }}
45-
45+
4646
- name: Generate coverage badge
4747
run: |
4848
poetry run python -c "
4949
import xml.etree.ElementTree as ET
5050
import re
51-
51+
5252
# Parse the coverage report
5353
tree = ET.parse('coverage.xml')
5454
root = tree.getroot()
55-
55+
5656
# Get the overall coverage percentage
5757
coverage = float(root.get('line-rate')) * 100
58-
58+
5959
# Create the badge markdown
6060
color = 'red'
6161
if coverage >= 90:
@@ -68,13 +68,13 @@ jobs:
6868
color = 'yellow'
6969
elif coverage >= 50:
7070
color = 'orange'
71-
71+
7272
badge_url = f'https://img.shields.io/badge/coverage-{coverage:.1f}%25-{color}'
73-
73+
7474
# Update README.md
7575
with open('README.md', 'r') as f:
7676
readme = f.read()
77-
77+
7878
# Look for existing coverage badge
7979
coverage_badge_pattern = r'!\[Coverage\]\(https://img\.shields\.io/badge/coverage-[\d\.]+%25-[a-z]+\)'
8080
if re.search(coverage_badge_pattern, readme):
@@ -94,11 +94,11 @@ jobs:
9494
readme = readme[:first_line_end+1] + f'\n![Coverage]({badge_url})\n' + readme[first_line_end+1:]
9595
else:
9696
readme = readme + f'\n\n![Coverage]({badge_url})\n'
97-
97+
9898
with open('README.md', 'w') as f:
9999
f.write(readme)
100100
"
101-
101+
102102
- name: Commit updated README with coverage badge
103103
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
104104
run: |

.github/workflows/dependency-scanning.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,40 +15,40 @@ jobs:
1515
scan:
1616
name: Security Scan
1717
runs-on: ubuntu-latest
18-
18+
1919
steps:
2020
- name: Checkout code
2121
uses: actions/checkout@v4
22-
22+
2323
- name: Set up Python
2424
uses: actions/setup-python@v5
2525
with:
2626
python-version: '3.12'
27-
27+
2828
- name: Install Poetry
2929
run: |
3030
curl -sSL https://install.python-poetry.org | python3 -
3131
echo "$HOME/.local/bin" >> $GITHUB_PATH
32-
32+
3333
- name: Install poetry export plugin
3434
run: |
3535
poetry self add poetry-plugin-export
36-
36+
3737
- name: Install dependencies and export requirements
3838
run: |
3939
poetry install
4040
poetry export -f requirements.txt --without-hashes -o requirements.txt
41-
41+
4242
- name: Run safety check
4343
run: |
4444
pip install safety
4545
safety check -r requirements.txt --full-report || true
46-
46+
4747
- name: Check for outdated dependencies
4848
run: |
4949
pip install pip-audit
5050
pip-audit -r requirements.txt || true # Don't fail workflow on findings
51-
51+
5252
- name: Cache results
5353
uses: actions/cache@v4
5454
with:

.github/workflows/docstring-coverage.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,42 @@ on:
1010
jobs:
1111
docstring-coverage:
1212
runs-on: ubuntu-latest
13-
13+
1414
steps:
1515
- uses: actions/checkout@v4
16-
16+
1717
- name: Set up Python
1818
uses: actions/setup-python@v5
1919
with:
2020
python-version: "3.12"
21-
21+
2222
- name: Install dependencies
2323
run: |
2424
python -m pip install --upgrade pip
25-
25+
2626
- name: Check docstring coverage
2727
run: |
2828
python scripts/check_docstring_coverage.py --min-coverage 80
29-
29+
3030
- name: Generate docstring coverage badge
3131
run: |
3232
python -c "
3333
import re
3434
import subprocess
3535
import json
36-
36+
3737
# Run the docstring coverage script and capture output
3838
result = subprocess.run(
3939
['python', 'scripts/check_docstring_coverage.py', '--dir', 'src'],
4040
capture_output=True,
4141
text=True
4242
)
43-
43+
4444
# Extract the overall coverage percentage
4545
match = re.search(r'Overall docstring coverage: (\d+\.\d+)%', result.stdout)
4646
if match:
4747
coverage = float(match.group(1))
48-
48+
4949
# Determine badge color
5050
color = 'red'
5151
if coverage >= 90:
@@ -58,14 +58,14 @@ jobs:
5858
color = 'yellow'
5959
elif coverage >= 50:
6060
color = 'orange'
61-
61+
6262
# Create badge URL
6363
badge_url = f'https://img.shields.io/badge/docstring%20coverage-{coverage:.1f}%25-{color}'
64-
64+
6565
# Update README.md
6666
with open('README.md', 'r') as f:
6767
readme = f.read()
68-
68+
6969
# Look for existing docstring coverage badge
7070
docstring_badge_pattern = r'!\[Docstring Coverage\]\(https://img\.shields\.io/badge/docstring%20coverage-[\d\.]+%25-[a-z]+\)'
7171
if re.search(docstring_badge_pattern, readme):
@@ -85,15 +85,15 @@ jobs:
8585
readme = readme[:first_line_end+1] + f'\\n![Docstring Coverage]({badge_url})\\n' + readme[first_line_end+1:]
8686
else:
8787
readme = readme + f'\\n\\n![Docstring Coverage]({badge_url})\\n'
88-
88+
8989
with open('README.md', 'w') as f:
9090
f.write(readme)
91-
91+
9292
print(f'Updated README.md with docstring coverage badge: {coverage:.1f}%')
9393
else:
9494
print('Could not extract docstring coverage percentage')
9595
"
96-
96+
9797
- name: Commit updated README with docstring coverage badge
9898
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
9999
run: |
@@ -104,6 +104,6 @@ jobs:
104104
git commit -m "docs: update docstring coverage badge [skip ci]"
105105
git push
106106
)
107-
107+
108108
permissions:
109109
contents: write

.github/workflows/docstrings-coverage.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,42 @@ on:
1010
jobs:
1111
docstring-coverage:
1212
runs-on: ubuntu-latest
13-
13+
1414
steps:
1515
- uses: actions/checkout@v4
16-
16+
1717
- name: Set up Python
1818
uses: actions/setup-python@v5
1919
with:
2020
python-version: "3.12"
21-
21+
2222
- name: Install dependencies
2323
run: |
2424
python -m pip install --upgrade pip
25-
25+
2626
- name: Check docstring coverage
2727
run: |
2828
python scripts/check_docstring_coverage.py --min-coverage 80
29-
29+
3030
- name: Generate docstring coverage badge
3131
run: |
3232
python -c "
3333
import re
3434
import subprocess
3535
import json
36-
36+
3737
# Run the docstring coverage script and capture output
3838
result = subprocess.run(
3939
['python', 'scripts/check_docstring_coverage.py', '--dir', 'src'],
4040
capture_output=True,
4141
text=True
4242
)
43-
43+
4444
# Extract the overall coverage percentage
4545
match = re.search(r'Overall docstring coverage: (\d+\.\d+)%', result.stdout)
4646
if match:
4747
coverage = float(match.group(1))
48-
48+
4949
# Determine badge color
5050
color = 'red'
5151
if coverage >= 90:
@@ -58,14 +58,14 @@ jobs:
5858
color = 'yellow'
5959
elif coverage >= 50:
6060
color = 'orange'
61-
61+
6262
# Create badge URL
6363
badge_url = f'https://img.shields.io/badge/docstring%20coverage-{coverage:.1f}%25-{color}'
64-
64+
6565
# Update README.md
6666
with open('README.md', 'r') as f:
6767
readme = f.read()
68-
68+
6969
# Look for existing docstring coverage badge
7070
docstring_badge_pattern = r'!\[Docstring Coverage\]\(https://img\.shields\.io/badge/docstring%20coverage-[\d\.]+%25-[a-z]+\)'
7171
if re.search(docstring_badge_pattern, readme):
@@ -85,15 +85,15 @@ jobs:
8585
readme = readme[:first_line_end+1] + f'\\n![Docstring Coverage]({badge_url})\\n' + readme[first_line_end+1:]
8686
else:
8787
readme = readme + f'\\n\\n![Docstring Coverage]({badge_url})\\n'
88-
88+
8989
with open('README.md', 'w') as f:
9090
f.write(readme)
91-
91+
9292
print(f'Updated README.md with docstring coverage badge: {coverage:.1f}%')
9393
else:
9494
print('Could not extract docstring coverage percentage')
9595
"
96-
96+
9797
- name: Commit updated README with docstring coverage badge
9898
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
9999
run: |
@@ -104,6 +104,6 @@ jobs:
104104
git commit -m "docs: update docstring coverage badge [skip ci]"
105105
git push
106106
)
107-
107+
108108
permissions:
109109
contents: write

0 commit comments

Comments
 (0)