Skip to content

Commit 4e7a282

Browse files
committed
add ruff-Linter
1 parent d7524a5 commit 4e7a282

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed

.github/workflows/pylint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Pylint Code Check
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
pull_request:
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.12'
24+
25+
- name: Install Dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install pylint
29+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
30+
31+
- name: Run Pylint
32+
run: |
33+
pylint --exit-zero $(git ls-files '*.py')

.github/workflows/ruff.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
permissions:
2+
contents: read
3+
name: Ruff Linter
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
pull_request:
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.12'
23+
24+
- name: Install Ruff
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install ruff
28+
29+
- name: Run Ruff
30+
run: |
31+
ruff check .

.pylintrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[MESSAGES CONTROL]
2+
disable=
3+
C0103,
4+
C0116,
5+
E0401,
6+
W0311,
7+
R0801,
8+
E0602,
9+
C0302,
10+
R0903,
11+
C0209,
12+
W1514,
13+
R0917,
14+
W0613,
15+
R1732,
16+
R1702,
17+
missing-docstring,
18+
too-many-arguments,
19+
line-too-long
20+

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[tool.ruff]
2+
line-length = 120
3+
lint.select = ["E","F","W"]
4+
lint.ignore = ["E501","E722","E741","E402","E731","F401","F821","F811","F405","F403","F841","W191"]

0 commit comments

Comments
 (0)