Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom linters to pipeline #426

Merged
merged 2 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -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 .
5 changes: 3 additions & 2 deletions metrics/getset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
Loading