Skip to content

Commit 5ef9dbb

Browse files
chore: setup poe tasks and fix linting/formatting
1 parent 9f8c59c commit 5ef9dbb

4 files changed

Lines changed: 45 additions & 12 deletions

File tree

annotator/cli.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@
1313
# The exact template with comments for the --init command
1414
INIT_CONFIG_CONTENT = """{
1515
// List of templates to apply (keeping default as is always recommended)
16-
// Add more templates in the list
17-
// existing templates can be seen here `https://github.com/assignment-sets/annotator-cli`
16+
// Add more templates in the list
17+
// existing templates can be seen here `https://github.com/assignment-sets/annotator-cli`
1818
"templates": ["default"],
19-
19+
2020
// Behavior settings
2121
"settings": {
2222
"max_recursive_depth": 10, // How deep to recurse into folders
2323
"max_num_of_files": 1000, // Maximum files to process
2424
"max_file_size_kb": 512 // Skip files larger than this
2525
},
26-
26+
2727
// Override comment styles for specific extensions
2828
// Example: ".kt": "//", ".scala": "//"
2929
"comment_styles": {},
30-
30+
3131
// Additional file extensions to exclude (beyond defaults)
3232
// Example: [".txt", ".log"]
33-
// keeping existing items is prefered
33+
// keeping existing items is prefered
3434
"exclude_extensions": [".log", ".cache"],
35-
35+
3636
// Additional directories to exclude (supports nested paths)
3737
// Example: ["temp", "cache", "src/generated/proto"]
3838
// keeping existing items is prefered
3939
"exclude_dirs": ["node_modules", ".venv", "__pycache__", "dist", "build", "target", "bin", ".git"],
40-
40+
4141
// Additional specific file `names` to exclude [no support for nested paths]
4242
// Example: [".env.local", "config.json"]
4343
// keeping existing items is prefered
@@ -204,7 +204,7 @@ def get_config(root: str) -> Dict[str, Any]:
204204
final_config = merge_configs(final_config, user_overrides)
205205

206206
# Final summary
207-
print(f"\n[CONFIG SUMMARY]")
207+
print("\n[CONFIG SUMMARY]")
208208
print(f" Comment styles: {len(final_config.get('comment_styles', {}))}")
209209
print(f" Excluded extensions: {len(final_config.get('exclude_extensions', []))}")
210210
print(f" Excluded files: {len(final_config.get('exclude_files', []))}")
@@ -254,11 +254,11 @@ def run_init(root: str) -> None:
254254
try:
255255
with open(gitignore_path, "w", encoding="utf-8") as f:
256256
f.write("# Annotator exclusions\nnode_modules/\n.DS_Store\n")
257-
print(f"[INIT] Created .gitignore")
257+
print("[INIT] Created .gitignore")
258258
except Exception as e:
259259
print(f"[ERROR] Failed to create .gitignore: {e}")
260260
else:
261-
print(f"[SKIP] .gitignore already exists.")
261+
print("[SKIP] .gitignore already exists.")
262262

263263

264264
def main() -> None:

annotator/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os
2-
from typing import Any, Dict, List, Optional, Set
2+
from typing import Any, Dict, Optional, Set
33

44
# Unique signature to identify our annotations for stateless revert
55
SIGNATURE: str = "~annotator~"

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,17 @@ annotator = ["templates/*.json"]
2525

2626
[dependency-groups]
2727
dev = [
28+
"poethepoet>=0.41.0",
2829
"pre-commit>=4.5.1",
2930
"pytest>=9.0.2",
3031
"pytest-cov>=7.0.0",
3132
"ruff>=0.15.2",
3233
]
34+
35+
[tool.poe.tasks]
36+
test = "pytest"
37+
test-cov = "pytest --cov=annotator tests/ --cov-report=term-missing"
38+
check = "ruff check ."
39+
fix = "ruff check --fix ."
40+
format = "ruff format ."
41+
lint = ["fix", "format"]

uv.lock

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)