@@ -21,9 +21,7 @@ uv sync --locked --all-extras --dev
2121
2222| Task | Command |
2323| ---| ---|
24- | Format check | ` uv run ruff format --check . ` |
2524| Auto-format | ` uv run ruff format . ` |
26- | Lint | ` uv run ruff check . ` |
2725| Lint + auto-fix | ` uv run ruff check --fix --unsafe-fixes . ` |
2826| Type check | ` uv run mypy . ` |
2927| Run all tests | ` uv run pytest ` |
@@ -32,7 +30,7 @@ uv sync --locked --all-extras --dev
3230
3331** Before marking any task as complete, always run:**
3432``` bash
35- uv run ruff check . && uv run mypy . && uv run pytest
33+ uv run ruff check --fix --unsafe-fixes . && uv run mypy . && uv run pytest
3634```
3735
3836---
@@ -70,60 +68,7 @@ PEP8 + Black. Run `uv run ruff check --fix --unsafe-fixes .` then `uv run ruff f
7068
7169---
7270
73- ## Import Conventions
7471
75- Every source file begins with:
76-
77- ``` python
78- from __future__ import annotations
79- ```
80-
81- Import ordering within a file:
82-
83- 1 . ` from __future__ import annotations ` — always first
84- 2 . Standard library bare imports (` import os ` , ` import sys ` , …)
85- 3 . Standard library ` from … import … `
86- 4 . Third-party bare imports
87- 5 . Third-party ` from … import … `
88- 6 . ` if TYPE_CHECKING: ` block — types needed only for annotations
89-
90- ``` python
91- from __future__ import annotations
92-
93- import contextlib
94- import os
95- from pathlib import Path
96- from typing import TYPE_CHECKING , Any
97-
98- import coverage
99-
100- if TYPE_CHECKING :
101- from collections.abc import Iterable
102- from coverage.types import TLineNo
103- from tree_sitter import Node
104- ```
105-
106- - Within the package: use ** relative** imports (` from .plugin import ShellPlugin ` )
107- - In tests and externally: use ** absolute** imports (` from coverage_sh.plugin import … ` )
108- - Put ` TYPE_CHECKING ` -only imports in the ` if TYPE_CHECKING: ` block to avoid runtime cost
109-
110- ---
111-
112- ## Naming Conventions
113-
114- | Construct | Convention | Example |
115- | ---| ---| ---|
116- | Modules / files | ` snake_case ` | ` plugin.py ` , ` test_plugin.py ` |
117- | Classes | ` PascalCase ` | ` ShellFileReporter ` , ` CovLineParser ` |
118- | Test classes | ` Test ` prefix | ` TestShellFileReporter ` |
119- | Functions / methods | ` snake_case ` | ` find_executable_files() ` |
120- | Private methods | leading ` _ ` | ` _parse_ast() ` , ` _iterdir() ` |
121- | Test methods | ` test_<what>_should_<expected_outcome> ` | ` test_source_should_be_cached ` |
122- | Module constants | ` UPPER_SNAKE_CASE ` | ` TRACEFILE_PREFIX ` , ` TMP_PATH ` |
123- | Local variables | ` snake_case ` | ` fifo_path ` , ` line_data ` |
124- | Type aliases | ` PascalCase ` | ` LineData = dict[str, set[int]] ` |
125-
126- ---
12772
12873## Error Handling
12974
0 commit comments