Skip to content

Commit 63f96b0

Browse files
committed
chore(dev): add quiet modes to suppress success messages
- Add -q flag to ruff check and format commands to suppress success messages - Add --no-error-summary to mypy to suppress success messages - Create dev/pyright-quiet.sh script to filter pyright summary (only when all 0s) - Add --quiet flag to shiv commands in build:zipapp and test utilities - Extract pre-commit install logic to dev/install_pre_commit_hooks.sh script
1 parent 4ea9b4b commit 63f96b0

File tree

7 files changed

+104
-95
lines changed

7 files changed

+104
-95
lines changed

.serger.jsonc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,9 @@
2828
"exclude": [
2929
"__pycache__/**",
3030
"*.pyc",
31-
// Temporarily including __init__.py files to fix apathetic_logging stitching
32-
// "src/**/__init__.py", // Exclude __init__.py for our own packages (handled by import shims)
3331
"**/__main__.py" // Entry point, not stitched
3432
],
3533

36-
// Output file path (relative to project root)
37-
// This will be the final single-file executable
38-
"out": "dist/serger.py",
39-
4034
// Global configuration defaults
41-
"log_level": "info",
42-
"strict_config": true,
43-
"respect_gitignore": true
35+
"log_level": "warning"
4436
}

dev/install_pre_commit_hooks.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
# Install pre-commit hooks if they're not already installed
4+
5+
if [ ! -f .git/hooks/pre-commit ] || ! grep -q 'pre-commit' .git/hooks/pre-commit 2>/dev/null; then
6+
poetry run pre-commit install --install-hooks
7+
poetry run pre-commit install --hook-type pre-push
8+
fi
9+

dev/pyright-quiet.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
# Run pyright and filter out the summary line only when all counts are 0, preserving exit code
4+
# Accepts all pyright arguments and passes them through
5+
6+
pyright "$@" 2>&1 | grep -vE '^0 error(s)?, 0 warning(s)?, 0 information(s)?$' || exit ${PIPESTATUS[0]}
7+

poetry.lock

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

pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ lint = ["lint:ruff"]
4848

4949
# 🧠 Type checking
5050
typecheck = ["typecheck:mypy", "typecheck:pyright"]
51-
"typecheck:mypy" = "mypy src tests"
51+
"typecheck:mypy" = "mypy src tests --no-error-summary"
5252
# run pyright to simulate pylance for AI CLI auto-fix
53-
"typecheck:pyright" = "pyright src tests"
53+
"typecheck:pyright" = "bash dev/pyright-quiet.sh src tests"
5454

5555
# 🧪 Tests (runs all three: installed + singlefile + zipapp)
5656
test = ["test:pytest:installed", "test:pytest:script", "test:pytest:zipapp"]
@@ -127,15 +127,15 @@ test = ["test:pytest:installed", "test:pytest:script", "test:pytest:zipapp"]
127127
# 🧹 Automated fixing / formatting
128128
fix = ["sync:ai:guidance", "fix:ruff:installed", "fix:format:installed"]
129129
"fix:dist" = ["fix:ruff:dist", "fix:format:dist"]
130-
"fix:ruff:installed" = "ruff check . --fix"
131-
"fix:ruff:dist" = { shell = "if [ -d dist ]; then ruff check dist --fix; fi" }
132-
"fix:format:installed" = "ruff format ."
133-
"fix:format:dist" = { shell = "if [ -d dist ]; then ruff format dist; fi" }
130+
"fix:ruff:installed" = "ruff check . --fix -q"
131+
"fix:ruff:dist" = { shell = "if [ -d dist ]; then ruff check dist --fix -q; fi" }
132+
"fix:format:installed" = "ruff format . -q"
133+
"fix:format:dist" = { shell = "if [ -d dist ]; then ruff format dist -q; fi" }
134134

135135
# 🧩 Build and license
136136
"sync:ai:guidance" = "python dev/sync_ai_guidance.py --quiet"
137137
"build:script" = "python -m serger"
138-
"build:zipapp" = "shiv -c serger -o dist/serger.pyz ."
138+
"build:zipapp" = "shiv -c serger -o dist/serger.pyz . --quiet"
139139
"check:license" = "bash dev/check-license.sh"
140140

141141
# 🚀 Release management (semantic-release)
@@ -144,7 +144,7 @@ fix = ["sync:ai:guidance", "fix:ruff:installed", "fix:format:installed"]
144144
"release:changelog" = "semantic-release changelog"
145145

146146
# 🔧 Setup and installation
147-
"pre-commit:install" = { shell = "if [ ! -f .git/hooks/pre-commit ] || ! grep -q 'pre-commit' .git/hooks/pre-commit 2>/dev/null; then poetry run pre-commit install --install-hooks && poetry run pre-commit install --hook-type pre-push; fi" }
147+
"pre-commit:install" = "bash dev/install_pre_commit_hooks.sh"
148148

149149
# 🐍 Python version management
150150
"env:py310" = "bash dev/env_use_py310.sh"

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def _filter_runtime_mode_tests(
127127
# ----------------------------------------------------------------------
128128

129129

130-
def pytest_report_header(config: pytest.Config) -> str: # noqa: ARG001 # pyright: ignore[reportUnknownParameterType]
130+
def pytest_report_header(config: pytest.Config) -> str: # noqa: ARG001
131131
mode = _mode()
132132
return f"Runtime mode: {mode}"
133133

tests/utils/runtime_swap.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def ensure_zipapp_up_to_date(root: Path) -> Path:
129129
"-o",
130130
str(zipapp_path),
131131
".",
132+
"--quiet",
132133
],
133134
cwd=root,
134135
check=True,

0 commit comments

Comments
 (0)