Skip to content

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

Open
ChughShilpa wants to merge 1 commit into
kubeflow:masterfrom
ChughShilpa:lint
Open

chore(docs): Add targeted-file lint/format commands to AGENTS.md#3554
ChughShilpa wants to merge 1 commit into
kubeflow:masterfrom
ChughShilpa:lint

Conversation

@ChughShilpa
Copy link
Copy Markdown
Contributor

@ChughShilpa ChughShilpa commented May 27, 2026

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
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign johnugeorge for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@ChughShilpa
Copy link
Copy Markdown
Contributor Author

ChughShilpa commented May 27, 2026

Please review @andreyvelich @Fiona-Waters

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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
Copy link
Copy Markdown
Contributor

@Fiona-Waters Fiona-Waters left a comment

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

Copy link
Copy Markdown
Contributor

@Fiona-Waters Fiona-Waters left a comment

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

@google-oss-prow
Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Shilpa Chugh <shchugh@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants