-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathap120.bash
More file actions
executable file
·34 lines (27 loc) · 906 Bytes
/
ap120.bash
File metadata and controls
executable file
·34 lines (27 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# LINE_LENGTH=120
#
# type ruff | uv pip install isort black ruff
#
# # Sort imports
# isort --line-length=$LINE_LENGTH --profile=black "$@"
#
# # Format code
# black --skip-string-normalization --line-length=$LINE_LENGTH "$@"
#
# # Check for unused imports and variables (warn only, no removal)
# ruff check --select F401,F841 --no-fix --line-length=$LINE_LENGTH "$@"
#
# # Lint for errors only
# ruff check --select E --no-fix --line-length=$LINE_LENGTH "$@"
#!/bin/bash -e
LINE_LENGTH=120
# Install if Ruff missing (proxy for all tools)
if ! command -v ruff >/dev/null 2>&1; then
uv pip install isort black ruff
fi
# Sort imports
isort --line-length="$LINE_LENGTH" --profile=black "$@"
# Format code
black --skip-string-normalization --line-length="$LINE_LENGTH" "$@"
# Lint: unused imports/vars + errors (warn only)
ruff check --select E,F401,F841 --no-fix --line-length="$LINE_LENGTH" "$@"