Skip to content

Commit 3fc0325

Browse files
authored
Merge pull request #1 from Kanguros/refractor
Refractor
2 parents 769144e + 1990017 commit 3fc0325

59 files changed

Lines changed: 3138 additions & 1785 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
applyTo: "**"
3+
---
4+
5+
# Project Overview
6+
7+
## Coding Standards
8+
9+
- Use Black-compatible formatting (see Ruff config for line length and exclusions).
10+
- All public functions and classes should have type annotations.
11+
- Use snake_case for variable and function names.
12+
13+
## Development Workflow
14+
15+
- Use `poetry` for dependency management and virtual environment.
16+
- Run `pytest`, all tests must pass.
17+
- Use `pre-commit`.
18+
- Do not hardcode credentials; use environment variables or config files for secrets.
19+
20+
## File Structure
21+
22+
- `policy_inspector/`: Core library code.
23+
- `tests/`: Unit and integration tests.
24+
25+
## Key Guidelines
26+
27+
- Write docstrings for all public functions and classes.
28+
- Prefer context managers for resource handling.
29+
- Avoid hardcoding sensitive data.
30+
- Keep each instruction and code change focused and atomic.
31+
32+
## Tools and Dependencies
33+
34+
- Python 3.10+
35+
- Pydantic v2 for data models
36+
- Ruff for linting and formatting
37+
- Pytest for testing
38+
- Pre-commit for enforcing code quality
39+
40+
## Testing
41+
42+
- Place all tests in the `tests/` directory.
43+
- Use pytest fixtures for reusable test setup.
44+
- All new features must include corresponding tests.
45+
46+
## Miscellaneous
47+
48+
- Organize code with clear separation between core logic, examples, scripts, and tests.
49+
- Store this file in version control and update as standards change.

.github/workflows/lint_and_test.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,19 @@ jobs:
5050
- name: Install dependencies
5151
run: poetry install --no-interaction --with=dev
5252

53-
- name: Run pre-commit
54-
run: poetry run pre-commit run --all-files
53+
- name: Run pre-commit (skip pytest hook)
54+
run: poetry run pre-commit run --all-files --hook-stage manual
55+
56+
- name: Run pytest with coverage (terminal, XML, and HTML)
57+
run: poetry run pytest --cov=policy_inspector --cov-report=term-missing --cov-report=html
58+
env:
59+
PYTHONPATH: .
60+
61+
- name: Upload HTML coverage report
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: coverage-html
65+
path: htmlcov/
5566

5667
publish:
5768
name: Build and Publish

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,4 @@ cache/
146146
.notes
147147
/*.json
148148
/*.html
149+
repomix-output.md

.pre-commit-config.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ repos:
33
rev: v5.0.0
44
hooks:
55
- id: check-added-large-files
6-
- id: check-toml
76
- id: detect-private-key
87
- id: end-of-file-fixer
98

@@ -29,8 +28,8 @@ repos:
2928
- repo: https://github.com/astral-sh/ruff-pre-commit
3029
rev: v0.9.7
3130
hooks:
31+
- id: ruff-format
32+
types_or: [python, pyi]
3233
- id: ruff
3334
args: [--fix]
3435
types_or: [python, pyi]
35-
- id: ruff-format
36-
types_or: [python, pyi]

0 commit comments

Comments
 (0)