forked from lyarinet/Samba-Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.3 KB
/
Copy pathcode-quality.yml
File metadata and controls
53 lines (44 loc) · 1.3 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
name: Code Quality - Style Checks
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
style-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install quality tools
run: |
python -m pip install --upgrade pip
pip install flake8 black isort
- name: Check code formatting with Black
run: |
black --check --diff . || (
echo "Code is not formatted with Black. Run 'black .' to format."
exit 1
)
- name: Check import sorting with isort
run: |
isort --check-only --diff . || (
echo "Imports are not sorted. Run 'isort .' to sort."
exit 1
)
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics || (
echo "Flake8 found syntax errors that need to be fixed."
exit 1
)
- name: Lint with flake8 (full check)
run: |
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics || (
echo "Flake8 found style issues. Consider fixing them for better code quality."
exit 1
)
continue-on-error: true