chore: add ruff, markdownlint, and file-hygiene pre-commit hooks#91
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughRepository pre-commit configuration is expanded (Ruff, ruff-format, markdownlint-cli2, and standard pre-commit-hooks with exclusions). Documentation (CONTRIBUTING.md) clarifies pre-commit usage. Numerous whitespace/EOF, minor formatting, license, and pyproject build-backend adjustments applied across agents and templates. ChangesPre-commit Hooks Setup and Repository Hygiene
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
agents/langgraph/agentic_rag/LICENSE (1)
3-3:⚠️ Potential issue | 🟠 Major | ⚡ Quick winMissing copyright holder name in MIT License.
The copyright line specifies only the year but omits the copyright holder's name. The MIT License requires the format
Copyright (c) <year> <copyright holder>.Add the appropriate copyright holder name (e.g., "Red Hat, Inc." or the relevant entity) to complete the license declaration and ensure legal compliance.
📋 Suggested fix
-Copyright (c) 2026 +Copyright (c) 2026 Red Hat, Inc.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agents/langgraph/agentic_rag/LICENSE` at line 3, Update the MIT License header line in the LICENSE file so it includes the copyright holder name; replace the existing line "Copyright (c) 2026" with the full required format, e.g. "Copyright (c) 2026 Red Hat, Inc." (or the appropriate entity), ensuring the LICENSE file's top copyright declaration in agents/langgraph/agentic_rag/LICENSE is corrected.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@agents/langgraph/react_agent/LICENSE`:
- Line 3: Update the MIT License header by adding the copyright holder name
after the year on the copyright line (currently "Copyright (c) 2026"); for
example change it to "Copyright (c) 2026 Red Hat, Inc." (or the appropriate
entity) so the LICENSE file conforms to the required `Copyright (c) <year>
<copyright holder>` format.
In `@agents/llamaindex/websearch_agent/LICENSE`:
- Line 3: Update the LICENSE file's copyright line to include the copyright
holder name in the MIT license header (currently "Copyright (c) 2026"); replace
or augment that line to the required format such as "Copyright (c) 2026 Red Hat,
Inc." (or the correct entity name) so the MIT license header is complete and
legally compliant.
In `@agents/vanilla_python/openai_responses_agent/LICENSE`:
- Line 3: The LICENSE file's copyright line only has the year and must include
the copyright holder; open the LICENSE file and update the copyright line (the
single line that currently reads "Copyright (c) 2026") to include the owner name
(for example: "Copyright (c) 2026 Red Hat, Inc."); ensure the exact change is
applied in the LICENSE file and any other identical headers in the repo if
present.
---
Outside diff comments:
In `@agents/langgraph/agentic_rag/LICENSE`:
- Line 3: Update the MIT License header line in the LICENSE file so it includes
the copyright holder name; replace the existing line "Copyright (c) 2026" with
the full required format, e.g. "Copyright (c) 2026 Red Hat, Inc." (or the
appropriate entity), ensuring the LICENSE file's top copyright declaration in
agents/langgraph/agentic_rag/LICENSE is corrected.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 50714a96-36cb-4de9-be16-d2000608d4e3
⛔ Files ignored due to path filters (4)
agents/a2a/langgraph_crewai_agent/src/a2a_langgraph_crewai/images/rh_logo.svgis excluded by!**/*.svgagents/autogen/mcp_agent/images/rh_logo.svgis excluded by!**/*.svgimages/langgraph_logo.svgis excluded by!**/*.svgimages/rh_logo.svgis excluded by!**/*.svg
📒 Files selected for processing (23)
.pre-commit-config.yamlCONTRIBUTING.mdagents/autogen/mcp_agent/mcp_automl_template/AUTOML_DEPLOYMENT.mdagents/autogen/mcp_agent/mcp_automl_template/pyproject.tomlagents/crewai/websearch_agent/.env.exampleagents/crewai/websearch_agent/pyproject.tomlagents/google/adk/.env.exampleagents/langflow/simple_tool_calling_agent/flows/outdoor-activity-agent.jsonagents/langgraph/agentic_rag/LICENSEagents/langgraph/agentic_rag/data/sample_knowledge.txtagents/langgraph/react_agent/LICENSEagents/langgraph/react_agent/playground/templates/index.htmlagents/langgraph/react_with_database_memory/.gitignoreagents/langgraph/react_with_database_memory/playground/templates/index.htmlagents/langgraph/react_with_database_memory/pyproject.tomlagents/llamaindex/websearch_agent/LICENSEagents/llamaindex/websearch_agent/playground/templates/index.htmlagents/llamaindex/websearch_agent/pyproject.tomlagents/vanilla_python/openai_responses_agent/.env.exampleagents/vanilla_python/openai_responses_agent/LICENSEagents/vanilla_python/openai_responses_agent/playground/templates/index.htmlagents/vanilla_python/openai_responses_agent/pyproject.tomlrun_llama_server.yaml
💤 Files with no reviewable changes (2)
- agents/crewai/websearch_agent/.env.example
- agents/vanilla_python/openai_responses_agent/.env.example
| MIT License | ||
|
|
||
| Copyright (c) 2026 No newline at end of file | ||
| Copyright (c) 2026 |
There was a problem hiding this comment.
Missing copyright holder name in MIT License.
The copyright line specifies only the year but omits the copyright holder's name. The MIT License requires the format Copyright (c) <year> <copyright holder>.
Add the appropriate copyright holder name (e.g., "Red Hat, Inc." or the relevant entity) to complete the license declaration and ensure legal compliance.
📋 Suggested fix
-Copyright (c) 2026
+Copyright (c) 2026 Red Hat, Inc.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Copyright (c) 2026 | |
| Copyright (c) 2026 Red Hat, Inc. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@agents/langgraph/react_agent/LICENSE` at line 3, Update the MIT License
header by adding the copyright holder name after the year on the copyright line
(currently "Copyright (c) 2026"); for example change it to "Copyright (c) 2026
Red Hat, Inc." (or the appropriate entity) so the LICENSE file conforms to the
required `Copyright (c) <year> <copyright holder>` format.
| MIT License | ||
|
|
||
| Copyright (c) 2026 No newline at end of file | ||
| Copyright (c) 2026 |
There was a problem hiding this comment.
Missing copyright holder name in MIT License.
The copyright line specifies only the year but omits the copyright holder's name. The MIT License requires the format Copyright (c) <year> <copyright holder>.
Add the appropriate copyright holder name (e.g., "Red Hat, Inc." or the relevant entity) to complete the license declaration and ensure legal compliance.
📋 Suggested fix
-Copyright (c) 2026
+Copyright (c) 2026 Red Hat, Inc.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Copyright (c) 2026 | |
| Copyright (c) 2026 Red Hat, Inc. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@agents/llamaindex/websearch_agent/LICENSE` at line 3, Update the LICENSE
file's copyright line to include the copyright holder name in the MIT license
header (currently "Copyright (c) 2026"); replace or augment that line to the
required format such as "Copyright (c) 2026 Red Hat, Inc." (or the correct
entity name) so the MIT license header is complete and legally compliant.
| MIT License | ||
|
|
||
| Copyright (c) 2026 No newline at end of file | ||
| Copyright (c) 2026 |
There was a problem hiding this comment.
Missing copyright holder name in MIT License.
The copyright line specifies only the year but omits the copyright holder's name. The MIT License requires the format Copyright (c) <year> <copyright holder>.
Add the appropriate copyright holder name (e.g., "Red Hat, Inc." or the relevant entity) to complete the license declaration and ensure legal compliance.
📋 Suggested fix
-Copyright (c) 2026
+Copyright (c) 2026 Red Hat, Inc.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Copyright (c) 2026 | |
| Copyright (c) 2026 Red Hat, Inc. |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@agents/vanilla_python/openai_responses_agent/LICENSE` at line 3, The LICENSE
file's copyright line only has the year and must include the copyright holder;
open the LICENSE file and update the copyright line (the single line that
currently reads "Copyright (c) 2026") to include the owner name (for example:
"Copyright (c) 2026 Red Hat, Inc."); ensure the exact change is applied in the
LICENSE file and any other identical headers in the repo if present.
…a-services#91 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| @@ -20,3 +20,41 @@ repos: | |||
| - --subject-min-length=10 | |||
| - --subject-max-length=72 | |||
| - --allow-breaking | |||
There was a problem hiding this comment.
Suggestion: move file-hygiene hooks before ruff/markdownlint
Convention is to put the fast normalizers (trailing-whitespace, end-of-file-fixer, etc.) before language-specific linters so they see already-clean files. With the current order, if a Python file has trailing whitespace, both ruff and trailing-whitespace try to fix it — potentially causing a confusing double-modification on the first run.
Suggested repo order in the config:
- conventional-commits (commit-msg stage — order doesn't matter)
- pre-commit/pre-commit-hooks (file-hygiene)
- ruff-pre-commit
- markdownlint-cli2
tarun-etikala
left a comment
There was a problem hiding this comment.
Looks good overall
Move pre-commit-hooks (trailing-whitespace, end-of-file-fixer, etc.) before ruff and markdownlint so normalizers see already-clean files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
LGTM |
Description
Adds ruff linting/formatting, markdownlint, and file-hygiene hooks to
.pre-commit-config.yaml, building on the conventional commits hook from #85. Documents all pre-commit hooks inCONTRIBUTING.mdwith a new "Pre-commit hooks" section. Auto-fixes trailing whitespace and missing end-of-file newlines across 24 files viapre-commit run --all-files.Jira Ticket
RHAIENG-4061
Testing
pre-commit run --all-filespasses all 15 hooksChecklist
.envor secret files are included in this PRReview Guidance
.pre-commit-config.yaml— main deliverable. Review the hook selection and args (e.g.,--fixfor markdownlint,exclude: ^charts/for check-yaml,--maxkb=1000for large files,--branch=mainfor no-commit-to-branch)CONTRIBUTING.md— new "Pre-commit hooks" section documents all hooks with a table for file-hygiene hooksRelated PRs
ruff.toml(merged).markdownlint.jsonc(merged)