Skip to content

chore(docs): Add targeted-file lint/format commands to AGENTS.md - #3554

Merged
google-oss-prow[bot] merged 1 commit into
kubeflow:masterfrom
ChughShilpa:lint
Jun 19, 2026
Merged

chore(docs): Add targeted-file lint/format commands to AGENTS.md#3554
google-oss-prow[bot] merged 1 commit into
kubeflow:masterfrom
ChughShilpa:lint

Conversation

@ChughShilpa

@ChughShilpa ChughShilpa commented May 27, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

  • AGENTS.md only documented project-wide make targets for linting. When an AI agent (or contributor) changes a single file or package, running the full-project lint is slow and noisy. Documenting targeted single-file/package equivalents lets agents get fast, focused feedback on just the target paths it touched.
  • This PR adds a "Targeted lint/format" section with commands for checking specific files or packages, giving agents and contributors faster feedback on just the code they changed.
  • Adds a LINT_PKG variable to the Makefile (defaults to ./...) so make golangci-lint LINT_PKG=./pkg/controller/... lints a single package using the project-local binary, avoiding PATH mismatches with globally installed versions.
  • All commands were validated locally against the repo's actual tooling (Makefile, .pre-commit-config.yaml, .golangci.yaml).

Which issue(s) this PR fixes (optional, in Fixes #<issue number>, #<issue number>, ... format, will close the issue(s) when PR gets merged):
Fixes #

Checklist:

  • Docs included if any changes are user facing

Copilot AI review requested due to automatic review settings May 27, 2026 06:21
@google-oss-prow
google-oss-prow Bot requested review from jinchihe and kuizhiqing May 27, 2026 06:21
@ChughShilpa

ChughShilpa commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

Please review @andreyvelich @Fiona-Waters

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds documentation to help contributors run linting/formatting tools on a subset of the codebase for faster iteration.

Changes:

  • Document targeted (file/package/crate) commands for Go, Python, and Rust lint/format workflows.

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
@ChughShilpa ChughShilpa changed the title Add targeted-file lint/format commands to AGENTS.md docs: Add targeted-file lint/format commands to AGENTS.md May 27, 2026
@ChughShilpa ChughShilpa changed the title docs: Add targeted-file lint/format commands to AGENTS.md chore(docs): Add targeted-file lint/format commands to AGENTS.md May 27, 2026
@ChughShilpa
ChughShilpa force-pushed the lint branch 3 times, most recently from 8c45314 to 6b656e5 Compare May 27, 2026 07:02

@Fiona-Waters Fiona-Waters 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.

Thanks @ChughShilpa left a couple of comments

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated
@Fiona-Waters

Copy link
Copy Markdown
Contributor

/retest

@Fiona-Waters Fiona-Waters 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.

Thanks @ChughShilpa
/lgtm

@Fiona-Waters

Copy link
Copy Markdown
Contributor

/assign @kubeflow/kubeflow-trainer-team please review @andreyvelich

Comment thread AGENTS.md
Comment on lines +141 to +149
# Python
pre-commit run flake8 --files path/to/file.py # Lint a single Python file
pre-commit run black --files path/to/file.py # Format a single Python file
pre-commit run isort --files path/to/file.py # Sort imports in a single Python file

# Rust
cargo fmt --manifest-path pkg/data_cache/Cargo.toml # Format the data_cache crate (crate-level)
cargo check --manifest-path pkg/data_cache/Cargo.toml # Type-check the data_cache crate (crate-level)
```

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.

Shall we just run pre-commit run --all-files ?

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.

pre-commit run --all-files is already mentioned in Pre-commit and this will run for all files. This PR adds commands to execute against single file/package

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.

But i replace it with a single command

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.

@ChughShilpa We also use pre-commit for cargo check, shall we use it too?
https://github.com/kubeflow/trainer/blob/master/.pre-commit-config.yaml#L28-L35

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.

right, updated the cargo commands to use pre-commit

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.

@andreyvelich Can you please review

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Shilpa Chugh <shchugh@redhat.com>
@andreyvelich

Copy link
Copy Markdown
Member

/lgtm
/approve

@google-oss-prow google-oss-prow Bot added the lgtm label Jun 19, 2026
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andreyvelich

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
google-oss-prow Bot merged commit d75d957 into kubeflow:master Jun 19, 2026
30 of 32 checks passed
@google-oss-prow google-oss-prow Bot added this to the v2.3 milestone Jun 19, 2026
@ChughShilpa
ChughShilpa deleted the lint branch June 19, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants