Skip to content

Commit 184642e

Browse files
authored
feat: add linting configurations for Python and C++ (#1)
1 parent 5331e54 commit 184642e

File tree

4 files changed

+107
-0
lines changed

4 files changed

+107
-0
lines changed

.config/pylintrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[MASTER]
2+
ignore=venv
3+
4+
[MESSAGES CONTROL]
5+
disable=
6+
C0103, # invalid-name
7+
C0115, # missing-class-docstring
8+
C0116, # missing-function-docstring
9+
R0205, # useless-object-inheritance
10+
R0903, # too-few-public-methods
11+
12+
[FORMAT]
13+
max-line-length=100
14+
15+
[BASIC]
16+
variable-rgx=[a-z_][a-z0-9_]{0,30}$
17+
function-rgx=[a-z_][a-z0-9_]{2,30}$
18+
class-rgx=[A-Z][a-zA-Z0-9]+$
19+

.github/workflows/commitlint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Lint Commit Messages 📜
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- '**'
10+
11+
jobs:
12+
commitlint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- uses: wagoid/commitlint-github-action@v6

.github/workflows/cpplint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Lint with cpplint 🚦
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**/*.cpp'
9+
pull_request:
10+
branches:
11+
- '**'
12+
paths:
13+
- '**/*.cpp'
14+
15+
jobs:
16+
cpplint:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.11'
27+
28+
- name: Install cpplint
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install cpplint
32+
33+
- name: Run cpplint
34+
run: |
35+
cpplint --filter=-legal/copyright $(git ls-files '*.cpp')

.github/workflows/pythonlint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Lint with Pylint 🐍
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**/*.py'
9+
pull_request:
10+
branches:
11+
- '**'
12+
paths:
13+
- '**/*.py'
14+
15+
jobs:
16+
pylint:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.11'
27+
28+
- name: Install Pylint
29+
run: |
30+
python -m pip install --upgrade pip
31+
pip install pylint
32+
33+
- name: Run Pylint
34+
run: |
35+
pylint --rcfile=./.config/pylintrc $(git ls-files '*.py')

0 commit comments

Comments
 (0)