Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ This repository contains the `python-bsblan` library, an asynchronous Python cli
Always run these commands after making changes:

```bash
# Run all pre-commit hooks (ruff, mypy, pylint, pytest)
uv run pre-commit run --all-files
# Run all prek hooks (ruff, mypy, pylint)
prek run --all-files
Comment thread
liudger marked this conversation as resolved.
Outdated
```

### Pre-commit Includes
### Prek Includes
- **Ruff**: Linting and formatting (88 char line limit)
- **MyPy**: Static type checking
- **Pylint**: Code analysis
- **Pytest**: Test execution with coverage

### Coverage Requirements
- Maintain **95%+ total test coverage**
Expand Down Expand Up @@ -223,7 +222,7 @@ Test fixtures (JSON responses) are in `tests/fixtures/`
4. Update docstring with parameter description
5. Add state preparation logic in `_prepare_*_state()` method
6. Add tests for the new parameter
7. Run `uv run pre-commit run --all-files`
7. Run `prek run --all-files`
Comment thread
liudger marked this conversation as resolved.
Outdated

### Renaming a Parameter

Expand All @@ -233,7 +232,7 @@ When renaming parameters for consistency:
3. Update `bsblan.py` - method parameters and state handling
4. Update `tests/` - all test files using the parameter
5. Update `examples/` - any example code
6. Run `uv run pre-commit run --all-files`
6. Run `prek run --all-files`
Comment thread
liudger marked this conversation as resolved.
Outdated

## API Versions

Expand All @@ -245,7 +244,7 @@ Version-specific parameters are handled in `constants.py` with extension diction

## Don't Forget

- ✅ Run `uv run pre-commit run --all-files` after every change
- ✅ Run `prek run --all-files` after every change
Comment thread
liudger marked this conversation as resolved.
Outdated
- ✅ Maintain 95%+ test coverage
- ✅ Use type hints on all functions
- ✅ Add docstrings to public methods
Expand Down
2 changes: 1 addition & 1 deletion .github/prompts/add-parameter.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Add a new parameter to the python-bsblan library following the established patte

After changes, run:
```bash
uv run pre-commit run --all-files
prek run --all-files
Comment thread
liudger marked this conversation as resolved.
Outdated
```

Coverage must be 95%+ total and 100% for new code.
4 changes: 2 additions & 2 deletions .github/prompts/code-review.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Review the changes against the python-bsblan coding standards.
- [ ] Follows existing parameter naming conventions
- [ ] Error handling uses custom exceptions (`BSBLANError`, `BSBLANConnectionError`)

### Pre-commit
### Prek
- [ ] Ruff passes (linting + formatting)
- [ ] MyPy passes (type checking)
- [ ] Pylint passes (code analysis)
Expand All @@ -35,6 +35,6 @@ Review the changes against the python-bsblan coding standards.
## Run Validation

```bash
uv run pre-commit run --all-files
prek run --all-files
Comment thread
liudger marked this conversation as resolved.
Outdated
uv run pytest --cov=src/bsblan --cov-report=term-missing
```
2 changes: 1 addition & 1 deletion .github/skills/bsblan-parameters/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ When adding new sections or groups, the lock is created automatically on first a
Always run after changes:

```bash
uv run pre-commit run --all-files
prek run --all-files
Comment thread
liudger marked this conversation as resolved.
Outdated
uv run pytest --cov=src/bsblan --cov-report=term-missing
```

Expand Down
5 changes: 2 additions & 3 deletions .github/skills/bsblan-testing/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,19 @@ uv run pytest -v
uv run pytest tests/test_bsblan.py::test_function_name
```

## Pre-commit Hooks
## Prek Hooks

Always run before committing:

```bash
uv run pre-commit run --all-files
prek run --all-files
Comment thread
liudger marked this conversation as resolved.
Outdated
```

This runs:

- **Ruff**: Linting and formatting (88 char line limit)
- **MyPy**: Static type checking
- **Pylint**: Code analysis
- **Pytest**: Test execution with coverage

## Mock Patterns

Expand Down
36 changes: 18 additions & 18 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: 🏗 Install Python dependencies
run: uv sync --dev
- name: 🚀 Check code for common misspellings
run: uv run pre-commit run codespell --all-files
run: uv run prek run codespell --all-files

ruff:
name: Ruff
Expand All @@ -58,8 +58,8 @@ jobs:
- name: 🚀 Run ruff formatter
run: uv run ruff format --check .

pre-commit-hooks:
name: pre-commit-hooks
prek-hooks:
name: prek-hooks
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
Expand All @@ -76,31 +76,31 @@ jobs:
- name: 🏗 Install Python dependencies
run: uv sync --dev
- name: 🚀 Check Python AST
run: uv run pre-commit run check-ast --all-files
run: uv run prek run check-ast --all-files
- name: 🚀 Check for case conflicts
run: uv run pre-commit run check-case-conflict --all-files
run: uv run prek run check-case-conflict --all-files
- name: 🚀 Check docstring is first
run: uv run pre-commit run check-docstring-first --all-files
run: uv run prek run check-docstring-first --all-files
- name: 🚀 Check that executables have shebangs
run: uv run pre-commit run check-executables-have-shebangs --all-files
run: uv run prek run check-executables-have-shebangs --all-files
- name: 🚀 Check JSON files
run: uv run pre-commit run check-json --all-files
run: uv run prek run check-json --all-files
- name: 🚀 Check for merge conflicts
run: uv run pre-commit run check-merge-conflict --all-files
run: uv run prek run check-merge-conflict --all-files
- name: 🚀 Check for broken symlinks
run: uv run pre-commit run check-symlinks --all-files
run: uv run prek run check-symlinks --all-files
- name: 🚀 Check TOML files
run: uv run pre-commit run check-toml --all-files
run: uv run prek run check-toml --all-files
- name: 🚀 Check XML files
run: uv run pre-commit run check-yaml --all-files
run: uv run prek run check-yaml --all-files
- name: 🚀 Check YAML files
run: uv run pre-commit run check-yaml --all-files
run: uv run prek run check-yaml --all-files
- name: 🚀 Detect Private Keys
run: uv run pre-commit run detect-private-key --all-files
run: uv run prek run detect-private-key --all-files
- name: 🚀 Check End of Files
run: uv run pre-commit run end-of-file-fixer --all-files
run: uv run prek run end-of-file-fixer --all-files
- name: 🚀 Trim Trailing Whitespace
run: uv run pre-commit run trailing-whitespace --all-files
run: uv run prek run trailing-whitespace --all-files

pylint:
name: pylint
Expand All @@ -120,7 +120,7 @@ jobs:
- name: 🏗 Install Python dependencies
run: uv sync --dev
- name: 🚀 Run pylint
run: uv run pre-commit run pylint --all-files
run: uv run prek run pylint --all-files

yamllint:
name: yamllint
Expand Down Expand Up @@ -167,4 +167,4 @@ jobs:
- name: 🏗 Install NPM dependencies
run: npm install
- name: 🚀 Run prettier
run: uv run pre-commit run prettier --all-files
run: uv run prek run prettier --all-files
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ repos:
language: system
types: [python]
entry: uv run pylint --exit-zero
- id: pytest
name: 🧪 Running tests and test coverage with pytest
language: system
types: [python]
entry: uv run pytest
pass_filenames: false
- id: trailing-whitespace
name: ✄ Trim Trailing Whitespace
language: system
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ npm install
uv sync --dev
```

As this repository uses the [pre-commit][pre-commit] framework, all changes
are linted and tested with each commit. You can run all checks and tests
manually, using the following command:
As this repository uses [prek][prek] (a faster, Rust-based drop-in replacement
for pre-commit), all changes are linted and tested with each commit. You can
run all checks and tests manually, using the following command:

```bash
uv run pre-commit run --all-files
prek run --all-files
Comment thread
liudger marked this conversation as resolved.
Outdated
```

To run just the Python tests:
Expand Down Expand Up @@ -214,7 +214,7 @@ SOFTWARE.
[maintenance-shield]: https://img.shields.io/maintenance/yes/2026.svg
[uv]: https://docs.astral.sh/uv/
[uv-install]: https://docs.astral.sh/uv/getting-started/installation/
[pre-commit]: https://pre-commit.com/
[prek]: https://github.com/j178/prek
[project-stage-shield]: https://img.shields.io/badge/project%20stage-experimental-yellow.svg
[pypi]: https://pypi.org/project/python-bsblan/
[python-versions-shield]: https://img.shields.io/pypi/pyversions/python-bsblan
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ dev = [
"hatch>=1.14.1",
"isort==7.0.0",
"ty==0.0.18",
"pre-commit==4.5.1",
"prek>=0.3.3",
"pre-commit-hooks==6.0.0",
"pylint==4.0.5",
"pytest>=8.3.5",
Expand Down
71 changes: 26 additions & 45 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading