-
Notifications
You must be signed in to change notification settings - Fork 12
84 lines (70 loc) · 2.21 KB
/
code-style.yml
File metadata and controls
84 lines (70 loc) · 2.21 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Code Style
on:
push:
jobs:
editorconfig:
name: EditorConfig
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup EditorConfig Checker
uses: editorconfig-checker/action-editorconfig-checker@main
- name: Run EditorConfig Checker
run: editorconfig-checker
flake8:
name: Flake 8 (Python)
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
cache: pip
cache-dependency-path: |
**/requirements*.txt
- name: Install Flake8 (7.0.0)
run: |
python -m pip install --upgrade pip
pip install flake8==7.0.0
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Lint with flake8
run: |
flake8 docs --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 docs --count --max-complexity=12 --max-line-length=130 --statistics
file-naming:
name: File Naming Convention
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Check docs file naming
run: |
echo "Checking documentation filenames…"
invalid_files=$(find docs \
-type f \( \
-name "*.rst" \
-o -name "*.png" \
-o -name "*.jpg" \
-o -name "*.jpeg" \
-o -name "*.svg" \
-o -name "*.gif" \
-o -name "*.tiff" \
\) \
| grep -Ev '^docs/_(static|templates)/' \
| grep -E '[A-Z_]' || true)
if [ -n "$invalid_files" ]; then
echo "❌ Invalid documentation filenames found:"
echo "$invalid_files"
echo ""
echo "Rules:"
echo " - lowercase only"
echo " - use '-' as separator"
echo " - no underscores '_'"
echo " - exception: docs/_static/** and docs/_templates/**"
exit 1
fi
echo "✅ Documentation filenames look good."