Skip to content

Bazel: migrate lint/style checks to native Bazel configuration & add clean-coverage target - #221

Open
NikitaJangidBMW wants to merge 3 commits into
mainfrom
internal/replace-make-with-bazel-target
Open

Bazel: migrate lint/style checks to native Bazel configuration & add clean-coverage target#221
NikitaJangidBMW wants to merge 3 commits into
mainfrom
internal/replace-make-with-bazel-target

Conversation

@NikitaJangidBMW

@NikitaJangidBMW NikitaJangidBMW commented Jul 20, 2026

Copy link
Copy Markdown

Migrate code quality checks from make lint to Bazel's native linting via aspect_rules_lint,
and add a reusable cleanup target.

BUILD

  • Add sh_binary target //:clean-coverage -> executes cleanup script (equiv. make clean-coverage)
  • Tag helper targets (requirements_*) as manual to prevent inclusion in default build set

MODULE.bazel

  • Add dependency: rules_shell@0.6.1 — needed for shell script execution

.github/workflows/ci.yml

  • Rename job from "PyLint" → "Bazel Lint" for clarity
  • Install Bazel via bazel-contrib/setup-bazel@0.19.0 with caching enabled
  • Replace make lint with bazel build --config=lint //...

util/BUILD (new)

  • Export clean_coverage.sh for use as Bazel label

util/clean_coverage.sh (new)

  • Replaces make clean-coverage shell invocation

requirements_dev.txt

  • Relax pylint version constraint: pylint<4.0pylint>=3,<4.0 for flexibility
  • Lock file updated accordingly

Additional

  • .bazelrc: Update lint aspects path from //tools/lint//third_party/lint
  • tools/sphinx/BUILD: Tag requirements targets as manual
  • trlc/BUILD: Add filegroup py_sources
  • Update documentation/dev_setup.md to remove make lint command and add Bazel clean-coverage

@NikitaJangidBMW
NikitaJangidBMW requested a review from a team as a code owner July 20, 2026 11:46
@NikitaJangidBMW NikitaJangidBMW added the topic: bazel affects the bazelizing of the repository label Jul 20, 2026
@NikitaJangidBMW
NikitaJangidBMW force-pushed the internal/replace-make-with-bazel-target branch from b5845d6 to 34cd3a4 Compare July 20, 2026 11:52
@NikitaJangidBMW NikitaJangidBMW changed the title Bazel: add Style and Lint targets Bazel: add Style, Lint & clean-coverage targets Jul 21, 2026
@NikitaJangidBMW
NikitaJangidBMW force-pushed the internal/replace-make-with-bazel-target branch from df631db to 349970a Compare July 21, 2026 07:19
@hoe-jo
hoe-jo self-requested a review July 22, 2026 04:41

@hoe-jo hoe-jo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For Lint and Format already aspect rules lint is setup in Bazel, see
tools/lint -> pylint + ty (maybe change to pylint + ruff)
tools/format (-> ruff and buildifier)

@phiwuu phiwuu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please also update the section on make lint in file documentation/dev_setup.md

@NikitaJangidBMW

Copy link
Copy Markdown
Author

For Lint and Format already aspect rules lint is setup in Bazel, see tools/lint -> pylint + ty (maybe change to pylint + ruff) tools/format (-> ruff and buildifier)

@hoe-jo Thanks, that makes sense. We should reuse the existing Bazel lint/format pipeline rather than add parallel wrappers. The only concern is that replacing ty with ruff would drop type-checking coverage, since ruff is not a type checker.

@NikitaJangidBMW
NikitaJangidBMW force-pushed the internal/replace-make-with-bazel-target branch 2 times, most recently from 255b6b5 to e6249ab Compare July 27, 2026 06:48
@NikitaJangidBMW NikitaJangidBMW changed the title Bazel: add Style, Lint & clean-coverage targets Bazel: migrate lint/style checks to native Bazel configuration & add clean-coverage target Jul 27, 2026
@NikitaJangidBMW
NikitaJangidBMW force-pushed the internal/replace-make-with-bazel-target branch from e6249ab to d942852 Compare July 27, 2026 07:39
@NikitaJangidBMW
NikitaJangidBMW requested review from hoe-jo and phiwuu July 28, 2026 05:16
@NikitaJangidBMW NikitaJangidBMW added the internal Affects the CI, tests or refactorings only, not relevant to the end-user label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Affects the CI, tests or refactorings only, not relevant to the end-user topic: bazel affects the bazelizing of the repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants