Skip to content
Closed
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
4 changes: 4 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
- name: Analysing the code with pylint
run: pylint .

- name: Analyzing the code with Buildifier
run: |
bazel test //:pylint_test --test_output=errors

- name: Analyzing the code with Buildifier
run: |
bazel test //:format_test --test_output=errors
Expand Down
27 changes: 27 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,30 @@ format_test(
],
workspace = "//:WORKSPACE",
)

filegroup(
name = "all_py_files",
srcs = glob(
["**/*.py"],
exclude = [
"bazel-*/**",
"venv/**",
".ci/**",
],
),
)

py_test(
name = "pylint_test",
srcs = ["test/pylint_runner.py"],
args = [
"--rcfile=$(location .pylintrc)",
"$(locations :all_py_files)",
],
data = [
".pylintrc",
":all_py_files",
],
main = "test/pylint_runner.py",
#deps = ["@pypi//pylint"],
)
25 changes: 25 additions & 0 deletions test/pylint_runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2023 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Wrapper for running pylint inside bazel's sandbox
using the provided python toolchain
"""

import sys
from pylint import lint

if __name__ == "__main__":
args = sys.argv[1:]
lint.Run(args)
Loading