Skip to content

Commit 6cd5e77

Browse files
author
evgeniygerasimov
committed
add custom linters to pipeline
1 parent 696dc40 commit 6cd5e77

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

.github/workflows/pylint.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2021-2025 Yegor Bugayenko
2+
# SPDX-License-Identifier: MIT
3+
---
4+
# yamllint disable rule:line-length,shellcheck
5+
name: custom-pylint
6+
"on":
7+
push:
8+
branches:
9+
- master
10+
pull_request:
11+
branches:
12+
- master
13+
jobs:
14+
custom-lint:
15+
timeout-minutes: 15
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: 3.11
22+
- run: |
23+
pip install pylint
24+
pylint --load-plugins=custom_checkers -d all -e C0411 .

metrics/getset.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# This metric counts the number of getter and setter methods in a class.
66

77
import sys
8+
from typing import Final
89
from javalang import tree, parse
910

1011
sys.setrecursionlimit(10000)
@@ -29,8 +30,8 @@ def analyze_method(method: tree.MethodDeclaration) -> str | None:
2930

3031

3132
if __name__ == '__main__':
32-
java = sys.argv[1]
33-
metrics = sys.argv[2]
33+
java: Final[str] = sys.argv[1]
34+
metrics: Final[str] = sys.argv[2]
3435

3536
getter_count = 0
3637
setter_count = 0

0 commit comments

Comments
 (0)