Skip to content

test: integrate pylint into bazel - #325

Draft
furtib wants to merge 4 commits into
Ericsson:mainfrom
furtib:bazel-pylint
Draft

test: integrate pylint into bazel#325
furtib wants to merge 4 commits into
Ericsson:mainfrom
furtib:bazel-pylint

Conversation

@furtib

@furtib furtib commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Why:
We want to run pylint just as easily as Buildifier.

What:

  • Added a runner for pylint.
  • Obtain pylint through Bazel.
  • Removed unnecessary __init__.py files from src/ and test/foss. (Others are necessary for pytest.)

Addresses:
none

Note:
CI will fail due to lint issues in the caching tests see #324.

@furtib
furtib requested a review from Szelethus August 31, 2026 10:27
@furtib furtib self-assigned this Aug 31, 2026
@furtib furtib added enhancement New feature or request test ☑️ Adding or refactoring tests labels Aug 31, 2026

@nettle nettle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kudos @furtib!

Comment thread test/pylint/requirements.txt Outdated
Comment on lines +2 to +3
--hash=sha256:52f39653876c7dec3e3afd4c2696920e05c83832b9737afc21928f2d2eb7a753 \
--hash=sha256:986fed8bcf79fb82c78b18a53352a0b287a73817d6dbcfba3162da36667c49a0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering... do we need these?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hashes we dont; everything else is necessary. The hashes were just a byproduct of how I generated this file, removed.

Comment thread test/pylint/BUILD Outdated
paths = [
"src",
"test",
"__init__.py",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

__init__.py we don't I was just messing around and left it in by accident.

name = "pylint",
exclude = [
"**/__pycache__/**",
],

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically by default we should analyze only *.py files everywhere, but maybe exclude some particular files and locations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is and always will be just a single entry, I haven't really thought about default values.

Comment on lines +63 to +64
if "external" not in tags:
pylint_tags.append("external")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for may I ask?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This action does not depend on any of the Python files it analyzes, only the Pylint executable.
Due to this, even if a Python file were to be changed, this action would still be cached.
This tag ensures that this action is never cached.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so, I guess you refer to Tag conventions
I kind of doubt that we need this tag... Why this action should not be cached?
But if we do there should be (1) evidences and (2) a comment in the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request test ☑️ Adding or refactoring tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants