Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
- [ ] I have updated the docs (`README.md`, `docs/`, `examples/`) if user-facing behavior changed
- [ ] I have added unit tests that cover my changes (mocked, not requiring a live comlink service)
- [ ] Tests pass (`uv run pytest tests/`)
- [ ] Ruff linter and formatter pass (`uvx ruff check src/ tests/` and `uvx ruff format --check src/ tests/`)
- [ ] Ruff linter and formatter pass (`uv run ruff check src/ tests/` and `uv run ruff format --check src/ tests/`)
- [ ] Type check passes (`uv run ty check src/swgoh_comlink/`)
- [ ] I have not bundled unrelated changes in this PR

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ jobs:
with:
python-version: "3.12"

- name: Install dependencies
run: uv sync --locked --only-group lint

- name: Run Ruff linter
run: uvx ruff check src/ tests/
run: uv run --no-sync ruff check src/ tests/

- name: Run Ruff formatter check
# NOTE: Set continue-on-error to false once the initial formatting PR is merged
continue-on-error: true
run: uvx ruff format --check src/ tests/
run: uv run --no-sync ruff format --check src/ tests/

# ── Type check ─────────────────────────────────────────────────────────
type-check:
Expand Down
15 changes: 12 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@ repos:
- id: debug-statements

# ── Ruff linter & formatter (mirrors CI lint job) ─────────────────────
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.4
# Run via local uv so the version comes from uv.lock, same as CI.
- repo: local
hooks:
- id: ruff
args: [--fix]
name: ruff check
entry: uv run ruff check --fix --force-exclude
language: system
exclude: ^examples/
types: [python]
require_serial: true
- id: ruff-format
name: ruff format
entry: uv run ruff format --force-exclude
language: system
types: [python]
require_serial: true

# ── ty type checking (Astral, run via local uv) ───────────────────────
- repo: local
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ This project follows standard Python conventions, enforced by [Ruff](https://doc

**General principles:**

- Follow [PEP 8](https://peps.python.org/pep-0008/) for formatting — `uvx ruff format` handles this for you
- Follow [PEP 8](https://peps.python.org/pep-0008/) for formatting — `uv run ruff format` handles this for you
- Use **complete type annotations** on all functions, parameters, and return values — the package ships a `py.typed` marker, so downstream users' type checkers rely on them
- Use `from __future__ import annotations` at the top of each module for modern annotation syntax
- Use docstrings (Google style) on all public classes and methods — they are rendered into the API reference
Expand Down Expand Up @@ -444,8 +444,8 @@ commit would be left out of the changelog entirely. Commit Lint rejects `!` befo

```bash
# Lint and format
uvx ruff check src/ tests/
uvx ruff format --check src/ tests/
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/

# Type check
uv run ty check src/swgoh_comlink/
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,17 @@ test = [
typecheck = [
"ty>=0.0.34",
]
lint = [
"ruff>=0.8",
]
changelog = [
"git-changelog>=2.9,<3",
]
dev = [
{include-group = "test"},
{include-group = "typecheck"},
{include-group = "changelog"},
"ruff>=0.8",
{include-group = "lint"},
]
docs = [
# MkDocs 2.0 removes the plugin system (mkdocstrings) and theme overrides that this
Expand Down
4 changes: 4 additions & 0 deletions uv.lock

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

Loading