Skip to content

bazel: expose and alias reusable //:fix_lint linter target - #4391

Closed
oharboe wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:share-fix-lint
Closed

oharboe wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
oharboe:share-fix-lint

Conversation

@oharboe

@oharboe oharboe commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR exposes the Bazel-managed linter/formatter target (//:fix_lint and //:lint_test) from tools/OpenROAD so that OpenROAD-flow-scripts (ORFS) can reuse OpenROAD's version-pinned linter toolchain (tclint, tclfmt, buildifier) as a Single Source of Truth (SOT).

Key Changes

  • ORFS flow/BUILD: Added top-level fix_lint and lint_test alias targets pointing to //tools/OpenROAD:fix_lint and //tools/OpenROAD:lint_test.
  • patches/openroad/: Carries a patch setting visibility = ["//visibility:public"].

Usage

Running bazelisk run //:fix_lint in ORFS executes the version-pinned linter toolchain on ORFS files (flow/scripts/**/*.tcl, flow/BUILD, MODULE.bazel).

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request aims to expose the fix_lint and lint_test targets by applying a patch to make them public in OpenROAD and defining aliases for them. However, two critical issues were identified: first, changing ]] to ] in flow/BUILD introduces a syntax error by leaving a list comprehension unclosed; second, the aliases are defined in flow/BUILD instead of the root BUILD.bazel file, which deviates from the intended root-level target usage.

Comment thread flow/BUILD Resolved
Comment thread flow/BUILD Resolved
@oharboe

oharboe commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Closing PR as redundant: Downstream workspaces like ORFS do not require local alias targets or patches in flow/BUILD. Once OpenROAD PRs #11057, #11058, and #11059 land, anyone in ORFS can directly execute:

bazelisk run @openroad//:fix_lint

from the root of ORFS to auto-format Tcl, Bazel, and YAML files across the repository using the exact version-pinned toolchain.

@oharboe oharboe closed this Aug 4, 2026
@oharboe oharboe reopened this Aug 4, 2026
@oharboe
oharboe requested a review from maliberty August 4, 2026 05:47
@oharboe

oharboe commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

moot

@oharboe oharboe closed this Aug 4, 2026
@oharboe

oharboe commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed the syntax error in flow/BUILD (restored ]] list comprehension closing brackets) and moved the fix_lint / lint_test alias targets into the repository root BUILD.bazel so bazelisk run //:fix_lint and bazelisk test //:lint_test can be invoked as root-level targets.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant