-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
41 lines (32 loc) · 992 Bytes
/
code-quality.yml
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
name: Code Quality Checks
on:
push:
paths:
- 'scrapegraphai/**'
- '.github/workflows/pylint.yml'
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Install dependencies
run: uv sync --frozen
- name: Run Ruff
run: uv run ruff check scrapegraphai
- name: Run Black
run: uv run black --check scrapegraphai
- name: Run isort
run: uv run isort --check-only scrapegraphai
- name: Analysing the code with pylint
run: uv run poe pylint-ci
- name: Check Pylint score
run: |
pylint_score=$(uv run poe pylint-score-ci | grep 'Raw metrics' | awk '{print $4}')
if (( $(echo "$pylint_score < 8" | bc -l) )); then
echo "Pylint score is below 8. Blocking commit."
exit 1
else
echo "Pylint score is acceptable."
fi