0

I have seen some threads that show me how to use Pylint as a test inside bazel. However, I want to use Pylint with one of the following commands:

bazel run --config=pylint or bazel build --config=pylint

What would be the best strategy here? In the future, I will use the same strategy to also implement black and buildifier as bazel run --config=black and bazel run --config=buildifier So I want to standarize it, if possible.

I am already able to run Pylint through a test, but this is not what I want.

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Nov 02 '22 at 19:01
  • 1
    This is very clearly explained [here](https://stackoverflow.com/questions/47303847/best-way-to-configure-pylint-with-bazel) – SG_Bazel Nov 03 '22 at 10:42
  • I don't want to run it as a test. I want to have a command that runs the pylint itself inside bazel. The same way as you use pylint outside bazel. – Andre Bruni Nov 03 '22 at 16:01

1 Answers1

0

This is explained in the documentation. You have to setup an alias() rule that points to the correct entry_point():

load("@pip_deps//:requirements.bzl", "entry_point")

alias(
    name = "pylint",
    actual = entry_point("pylint"),
)

This should then be executable via bazel run :pylint.

lummax
  • 333
  • 8