Skip to content

Commit 50b4241

Browse files
committed
simplify: Remove black, mypy, and bandit from linting
Per request, simplified the linting setup by removing: - black (code formatter) - mypy (type checker) - bandit (Python security linter) Kept: - ruff (fast Python linter for basic checks) - ansible-lint - yamllint - shellcheck - safety (dependency vulnerability scanner) This provides a good balance of code quality checks without being overly restrictive or requiring code style changes.
1 parent 458c82e commit 50b4241

File tree

3 files changed

+5
-54
lines changed

3 files changed

+5
-54
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,23 +56,13 @@ jobs:
5656
- name: Install Python linters
5757
run: |
5858
python -m pip install --upgrade pip
59-
pip install ruff black mypy
59+
pip install ruff
6060
6161
- name: Run ruff
6262
run: |
6363
# Fast Python linter
6464
ruff check . || true # Start with warnings only
6565
66-
- name: Check Python formatting with black
67-
run: |
68-
# Check formatting (don't modify)
69-
black --check --diff . || true # Start with warnings only
70-
71-
- name: Run mypy
72-
run: |
73-
# Type checking for Python
74-
mypy library/ --ignore-missing-imports || true # Start with warnings only
75-
7666
shellcheck:
7767
name: Shell script linting
7868
runs-on: ubuntu-22.04
@@ -102,12 +92,7 @@ jobs:
10292
- name: Install security tools
10393
run: |
10494
python -m pip install --upgrade pip
105-
pip install bandit safety
106-
107-
- name: Run bandit
108-
run: |
109-
# Security linter for Python
110-
bandit -r library/ || true # Start with warnings only
95+
pip install safety
11196
11297
- name: Check dependencies with safety
11398
run: |

docs/linting.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@ The project uses multiple linters to ensure code quality across different file t
2222
- `partial-become`: Avoid unnecessary privilege escalation
2323

2424
### 2. Python Linting
25-
- **Tools**:
26-
- `ruff` - Fast Python linter (replaces flake8, isort, etc.)
27-
- `black` - Code formatter
28-
- `mypy` - Type checker
29-
- `bandit` - Security linter
25+
- **Tool**: `ruff` - Fast Python linter (replaces flake8, isort, etc.)
3026
- **Config**: `pyproject.toml`
3127
- **Style**: 120 character line length, Python 3.10+
28+
- **Checks**: Syntax errors, imports, code style
3229

3330
### 3. Shell Script Linting
3431
- **Tool**: `shellcheck`
@@ -42,7 +39,6 @@ The project uses multiple linters to ensure code quality across different file t
4239

4340
### 5. Security Scanning
4441
- **Tools**:
45-
- `bandit` - Python security issues
4642
- `safety` - Known vulnerabilities in dependencies
4743
- `zizmor` - GitHub Actions security (run separately)
4844

@@ -68,8 +64,6 @@ ansible-lint -v *.yml roles/{local,cloud-*}/*/*.yml
6864

6965
# Python
7066
ruff check .
71-
black --check .
72-
mypy library/
7367

7468
# Shell
7569
find . -name "*.sh" -exec shellcheck {} \;
@@ -78,7 +72,6 @@ find . -name "*.sh" -exec shellcheck {} \;
7872
yamllint .
7973

8074
# Security
81-
bandit -r library/
8275
safety check
8376
```
8477

pyproject.toml

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,4 @@ select = [
1313
]
1414
ignore = [
1515
"E501", # line too long (handled by formatter)
16-
]
17-
18-
[tool.black]
19-
line-length = 120
20-
target-version = ['py310']
21-
include = '\.pyi?$'
22-
extend-exclude = '''
23-
(
24-
/(
25-
\.eggs
26-
| \.git
27-
| \.mypy_cache
28-
| \.tox
29-
| \.venv
30-
| _build
31-
| buck-out
32-
| build
33-
| dist
34-
)/
35-
)
36-
'''
37-
38-
[tool.mypy]
39-
python_version = "3.10"
40-
warn_return_any = true
41-
warn_unused_configs = true
42-
disallow_untyped_defs = false
43-
ignore_missing_imports = true
16+
]

0 commit comments

Comments
 (0)