Skip to content

Commit 97c71cd

Browse files
committed
style: apply Black code formatting via pre-commit
- Run pre-commit hooks on entire codebase - Apply consistent Black formatting to all Python files - Fix trailing whitespace and end-of-file formatting - Improve code readability and consistency across project
1 parent 3231897 commit 97c71cd

27 files changed

+376
-323
lines changed

.github/workflows/lint.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,29 @@ on:
99
jobs:
1010
lint:
1111
runs-on: ubuntu-latest
12-
12+
1313
steps:
1414
- uses: actions/checkout@v4
15-
15+
1616
- name: Set up Python
1717
uses: actions/setup-python@v4
1818
with:
1919
python-version: "3.11"
20-
20+
2121
- name: Install uv
2222
uses: astral-sh/setup-uv@v3
2323
with:
2424
version: "latest"
25-
25+
2626
- name: Create virtual environment
2727
run: uv venv
28-
28+
2929
- name: Install dependencies
3030
run: |
3131
source .venv/bin/activate
3232
uv pip install -e ".[dev]"
33-
33+
3434
- name: Run Black
3535
run: |
3636
source .venv/bin/activate
37-
black --check .
37+
black --check .

.github/workflows/publish.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@ on:
77
jobs:
88
publish:
99
runs-on: ubuntu-latest
10-
environment:
10+
environment:
1111
name: pypi
1212
url: https://pypi.org/p/pia-mcp-server
1313
permissions:
1414
id-token: write
15-
15+
1616
steps:
1717
- uses: actions/checkout@v4
18-
18+
1919
- name: Set up Python
2020
uses: actions/setup-python@v4
2121
with:
2222
python-version: "3.11"
23-
23+
2424
- name: Install uv
2525
uses: astral-sh/setup-uv@v3
2626
with:
2727
version: "latest"
28-
28+
2929
- name: Build package
3030
run: |
3131
uv build
32-
32+
3333
- name: Publish to PyPI
34-
uses: pypa/gh-action-pypi-publish@release/v1
34+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tests.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ jobs:
1515

1616
steps:
1717
- uses: actions/checkout@v4
18-
18+
1919
- name: Set up Python ${{ matrix.python-version }}
2020
uses: actions/setup-python@v4
2121
with:
2222
python-version: ${{ matrix.python-version }}
23-
23+
2424
- name: Install uv
2525
uses: astral-sh/setup-uv@v3
2626
with:
2727
version: "latest"
28-
28+
2929
- name: Create virtual environment
3030
run: uv venv
31-
31+
3232
- name: Install dependencies
3333
run: |
3434
source .venv/bin/activate
3535
uv pip install -e ".[test]"
36-
36+
3737
- name: Run tests
3838
run: |
3939
source .venv/bin/activate
@@ -43,26 +43,26 @@ jobs:
4343
runs-on: ubuntu-latest
4444
steps:
4545
- uses: actions/checkout@v4
46-
46+
4747
- name: Set up Python
4848
uses: actions/setup-python@v4
4949
with:
5050
python-version: "3.11"
51-
51+
5252
- name: Install uv
5353
uses: astral-sh/setup-uv@v3
5454
with:
5555
version: "latest"
56-
57-
- name: Create virtual environment
56+
57+
- name: Create virtual environment
5858
run: uv venv
59-
59+
6060
- name: Install dependencies
6161
run: |
6262
source .venv/bin/activate
6363
uv pip install -e ".[dev]"
64-
64+
6565
- name: Run Black
6666
run: |
6767
source .venv/bin/activate
68-
black --check .
68+
black --check .

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,4 @@ dmypy.json
150150
.pytype/
151151

152152
# Cython debug symbols
153-
cython_debug/
153+
cython_debug/

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ repos:
1212
rev: 23.3.0
1313
hooks:
1414
- id: black
15-
language_version: python3.11
15+
language_version: python3.11

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.11
1+
3.11

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ Additional hooks may be added as the project grows.
128128
```bash
129129
# Run tests
130130
python -m pytest
131-
131+
132132
# Run with coverage
133133
python -m pytest --cov=pia_mcp_server
134-
134+
135135
# Run pre-commit checks
136136
pre-commit run --all-files
137137
```
@@ -232,10 +232,10 @@ async def test_tool_functionality():
232232
"""Test description explaining what this tests."""
233233
# Arrange
234234
test_data = {"query": "test"}
235-
235+
236236
# Act
237237
result = await handle_tool(test_data)
238-
238+
239239
# Assert
240240
assert len(result) == 1
241241
assert "expected content" in result[0].text
@@ -357,13 +357,13 @@ logger = logging.getLogger(__name__)
357357

358358
async def handle_pia_search(arguments: Dict[str, Any]) -> List[types.TextContent]:
359359
"""Handle PIA search requests with OData filtering.
360-
360+
361361
Args:
362362
arguments: Search parameters including query and filters
363-
363+
364364
Returns:
365365
List of text content with search results
366-
366+
367367
Raises:
368368
ValueError: If required parameters are missing
369369
"""
@@ -399,4 +399,4 @@ Contributors will be recognized in:
399399
- Release notes for significant contributions
400400
- CONTRIBUTORS.md file (if created)
401401

402-
Thank you for contributing to the PIA MCP Server! 🎉
402+
Thank you for contributing to the PIA MCP Server! 🎉

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ ENV PYTHONPATH=/app/src
3232
ENV PIA_API_URL=https://mcp.programintegrity.org/
3333

3434
# Run the server
35-
CMD ["python", "-m", "pia_mcp_server"]
35+
CMD ["python", "-m", "pia_mcp_server"]

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ This MCP Server provides tools for working with Government Open Data which has b
1616
This data is updated weekly, and we will be adding more datasets and tools soon.
1717

1818
<div align="center">
19-
20-
🤝 **[Contribute](CONTRIBUTING.md)**
19+
20+
🤝 **[Contribute](CONTRIBUTING.md)**
2121
📝 **[Report Bug](https://github.com/Program-Integrity-Alliance/pia-mcp-local/issues)**
2222

2323
</div>
@@ -217,7 +217,7 @@ Filters: "data_source in ('OIG', 'CMS') and published_date ge '2023-01-01' and d
217217

218218
**Complex Example:**
219219
```
220-
Query: "healthcare violations"
220+
Query: "healthcare violations"
221221
Filters: "(data_source eq 'OIG' or data_source eq 'CMS') and (severity eq 'High' or amount gt 1000000) and published_date ge '2023-01-01'"
222222
```
223223

@@ -313,4 +313,4 @@ Released under the MIT License. See the LICENSE file for details.
313313

314314
Made with ❤️ for Government Transparency and Accountability
315315

316-
</div>
316+
</div>

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ exclude = '''
6767
| build
6868
| dist
6969
)/
70-
'''
70+
'''

0 commit comments

Comments
 (0)