Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 8 additions & 1 deletion img2num
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ run_in_container() {
# ---------------------------------------------------------------------------
# Ensure that Docker is available for the relevant commands.
case "$MODE" in
stop|restart|down|purge|destroy|logs)
stop|restart|down|purge|destroy|logs|lint-py)
Comment thread
Geff115 marked this conversation as resolved.
Resolved
command -v docker >/dev/null 2>&1 || {
echo "Error: docker is unavailable (not installed, not running or not in PATH)." >&2
exit 1
Expand All @@ -129,6 +129,11 @@ case "$MODE" in
pnpm)
run_in_container pnpm "$@"
;;

# Lint Python bindings and example apps with Ruff
lint-py)
run_in_container uv run --extra dev ruff check packages/py example-apps
;;
Comment thread
Geff115 marked this conversation as resolved.
Resolved

# Open a shell in the container
sh|shell|bash|term|terminal)
Expand Down Expand Up @@ -184,6 +189,8 @@ Commands:
pnpm <args> Run arbitrary pnpm command. [--img, --dh-img, --ghcr-img]
Open Container Terminal:
sh|shell|bash Opens bash terminal in Docker container. [--img, --dh-img, --ghcr-img]
Python:
lint-py Lint Python bindings and examples with Ruff. [--img, --dh-img, --ghcr-img]
Comment thread
Ryan-Millard marked this conversation as resolved.
Resolved
Comment thread
Geff115 marked this conversation as resolved.
Resolved
Docker Maintenance:
stop Stops running Docker container (keeps containers, volumes & networks).
restart Restarts running Docker container.
Expand Down
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,26 @@ members = [
# All example apps with "-py" suffix
"example-apps/*-py"
]

[tool.ruff]
target-version = "py310"
line-length = 88

Comment thread
Geff115 marked this conversation as resolved.
Resolved
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"B", # flake8-bugbear (mutable defaults, bare excepts, etc.)
"UP", # pyupgrade — modernise syntax
"SIM", # flake8-simplify
]
ignore = []
Comment thread
Geff115 marked this conversation as resolved.
Resolved

[tool.ruff.lint.per-file-ignores]
"**/__init__.py" = ["F401"] # Allow re-exports in __init__.py

[project.optional-dependencies]
dev = [
"ruff>=0.4.0",
]
Loading