diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 00000000..37596421 --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 Yegor Bugayenko +# SPDX-License-Identifier: MIT +name: pylint +"on": + push: + branches: + - master + pull_request: + branches: + - master +jobs: + pylint: + timeout-minutes: 15 + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.11 + - run: | + pip install pylint + pylint --load-plugins=custom_checkers -d all -e C0411 . diff --git a/metrics/getset.py b/metrics/getset.py index a45b1d4c..8501170c 100755 --- a/metrics/getset.py +++ b/metrics/getset.py @@ -5,6 +5,7 @@ # This metric counts the number of getter and setter methods in a class. import sys +from typing import Final from javalang import tree, parse sys.setrecursionlimit(10000) @@ -29,8 +30,8 @@ def analyze_method(method: tree.MethodDeclaration) -> str | None: if __name__ == '__main__': - java = sys.argv[1] - metrics = sys.argv[2] + java: Final[str] = sys.argv[1] + metrics: Final[str] = sys.argv[2] getter_count = 0 setter_count = 0