Conversation
Address code review feedback from PR tektoncd#2440: - Fix macro to pass command as second argument to xargs - Fix .PHONE typo to .PHONY for fix-python-errors target - Fix git status --porcelain usage (doesn't read from stdin) - Add || true to sed for consistency with other fix targets - Add -- separator to sed to prevent filename injection Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com> Assisted-by: Claude Opus 4.5 (via Claude Code)
Summary of ChangesHello @chmouel, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines several Makefile targets, primarily focusing on improving the reliability and correctness of linting and code-fixing operations. It addresses issues identified in a previous code review, enhancing the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
🔍 PR Lint Feedback
|
There was a problem hiding this comment.
Code Review
This pull request introduces several fixes and improvements to the Makefile, primarily focused on standardizing how file lists are passed to various linting and fixing commands. The new GIT_LS_FILES macro is a good step towards more robust and readable recipes. My review focuses on a regression introduced in the git status commands. While most changes are positive, I've identified that the new implementation for checking file status is not safe for filenames containing spaces and have suggested a fix that leverages the new macro to address this. Other changes, such as typo fixes and ensuring command consistency, are well-implemented.
| @$(call GIT_LS_FILES,$(MD_YAML_PATTERNS)) sed --in-place 's/[[:space:]]\+$$//' | ||
| @STATUS=$$($(call GIT_LS_FILES,$(MD_YAML_PATTERNS)) git status --porcelain) && \ | ||
| @$(call GIT_LS_FILES,$(MD_YAML_PATTERNS),sed --in-place 's/[[:space:]]\+$$//' --) || true | ||
| @STATUS=$$(git status --porcelain -- $$(git ls-files -- $(MD_YAML_PATTERNS))) && \ |
There was a problem hiding this comment.
This change introduces a potential issue with filenames containing spaces. The $$() command substitution is subject to word splitting by the shell, which can break the command if any file path contains spaces. The previous implementation using xargs -0 was safer. I recommend using the new GIT_LS_FILES macro here to ensure the command remains robust.
@STATUS=$$($(call GIT_LS_FILES,$(MD_YAML_PATTERNS),git status --porcelain)) && \
| @STATUS=$$($(call GIT_LS_FILES,$(PY_PATTERNS)) git status --porcelain) && \ | ||
| @$(call GIT_LS_FILES,$(PY_PATTERNS),ruff check --fix) || true | ||
| @$(call GIT_LS_FILES,$(PY_PATTERNS),ruff format) || true | ||
| @STATUS=$$(git status --porcelain -- $$(git ls-files -- $(PY_PATTERNS))) && \ |
There was a problem hiding this comment.
There was a problem hiding this comment.
Pull request overview
This PR addresses code review feedback from PR #2440 by fixing several issues in the Makefile related to file list handling and target declarations.
Changes:
- Fixed the
GIT_LS_FILESmacro to properly accept patterns and command as separate parameters and pass them correctly to xargs - Corrected
.PHONEtypo to.PHONYfor thefix-python-errorstarget - Fixed
git status --porcelaincommands to properly use command substitution instead of incorrect piping from xargs
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address code review feedback from PR #2440:
Assisted-by: Claude Opus 4.5 (via Claude Code)
📝 Description of the Change
👨🏻 Linked Jira
🔗 Linked GitHub Issue
Fixes #
🚀 Type of Change
fix:)feat:)feat!:,fix!:)docs:)chore:)refactor:)enhance:)deps:)🧪 Testing Strategy
🤖 AI Assistance
If you have used AI assistance, please provide the following details:
Which LLM was used?
Extent of AI Assistance:
Important
If the majority of the code in this PR was generated by an AI, please add a
Co-authored-bytrailer to your commit message.For example:
Co-authored-by: Gemini gemini@google.com
Co-authored-by: ChatGPT noreply@chatgpt.com
Co-authored-by: Claude noreply@anthropic.com
Co-authored-by: Cursor noreply@cursor.com
Co-authored-by: Copilot Copilot@users.noreply.github.com
**💡You can use the script
./hack/add-llm-coauthor.shto automatically addthese co-author trailers to your commits.
✅ Submitter Checklist
fix:,feat:) matches the "Type of Change" I selected above.make testandmake lintlocally to check for and fix anyissues. For an efficient workflow, I have considered installing
pre-commit and running
pre-commit installtoautomate these checks.