Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,41 @@ repos:
- --subject-min-length=10
- --subject-max-length=72
- --allow-breaking
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.

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:

  1. conventional-commits (commit-msg stage — order doesn't matter)
  2. pre-commit/pre-commit-hooks (file-hygiene)
  3. ruff-pre-commit
  4. markdownlint-cli2


# Standard file-hygiene hooks (run before linters so they see clean files)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: [--allow-multiple-documents]
exclude: ^charts/
- id: check-json
- id: check-toml
- id: check-merge-conflict
- id: check-added-large-files
args: [--maxkb=1000]
- id: debug-statements
- id: check-case-conflict
- id: mixed-line-ending
- id: no-commit-to-branch
args: [--branch=main]
- id: detect-private-key

# Ruff — Python linting and formatting
# Rules are defined in ruff.toml at the repo root
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.11
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

# Markdownlint — Markdown linting
# Rules are defined in .markdownlint.jsonc at the repo root
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.22.1
hooks:
- id: markdownlint-cli2
args: [--fix]
46 changes: 45 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,51 @@ uv tool install pre-commit
pre-commit install --install-hooks
```

After this, every `git commit` will automatically validate your commit message format (see below).
After this, every `git commit` will automatically run the checks listed in [Pre-commit hooks](#pre-commit-hooks) on your staged files. Commits that fail any check will be blocked.

If you haven't run `pre-commit install --install-hooks`, hooks will **not** run automatically. In that case, you can run all checks manually before committing:

```bash
pre-commit run --all-files
```

## Pre-commit hooks

The following hooks run automatically on every commit. They are defined in [`.pre-commit-config.yaml`](.pre-commit-config.yaml).

### Conventional commits

Enforces the [Conventional Commits](https://www.conventionalcommits.org/) format on commit messages (see [Commit message conventions](#commit-message-conventions) below). Runs at the `commit-msg` stage.

### Python linting and formatting (ruff)

Two hooks from [ruff](https://docs.astral.sh/ruff/):

- **ruff** — lints Python files and auto-fixes issues. Rules are defined in [`ruff.toml`](ruff.toml).
- **ruff-format** — enforces consistent formatting (quotes, indentation, line length).

### Markdown linting (markdownlint)

Lints `.md` files and auto-fixes what it can (e.g., list indentation, code block languages). Rules are defined in [`.markdownlint.jsonc`](.markdownlint.jsonc); ignored paths in [`.markdownlint-cli2.yaml`](.markdownlint-cli2.yaml).

### File-hygiene hooks

General-purpose checks from [pre-commit/pre-commit-hooks](https://github.com/pre-commit/pre-commit-hooks):

| Hook | What it does |
| ---- | ------------ |
| `trailing-whitespace` | Removes trailing whitespace from all files |
| `end-of-file-fixer` | Ensures every file ends with a newline |
| `check-yaml` | Validates YAML syntax (excludes `charts/` — Helm templates use Go syntax) |
| `check-json` | Validates JSON syntax |
| `check-toml` | Validates TOML syntax |
| `check-merge-conflict` | Detects leftover merge conflict markers |
| `check-added-large-files` | Blocks files larger than 1 MB |
| `debug-statements` | Catches leftover `breakpoint()` / `pdb` calls in Python |
| `check-case-conflict` | Detects filenames that differ only in case |
| `mixed-line-ending` | Ensures consistent line endings (no mixed LF/CRLF) |
| `no-commit-to-branch` | Blocks direct commits to `main` |
| `detect-private-key` | Catches accidentally committed private keys |

## Linting and formatting

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions agents/autogen/mcp_agent/images/rh_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ See: [Model Deployment](https://github.com/red-hat-data-services/red-hat-ai-exam

- Open the **deployment details**. Under **Inference endpoint**, copy the **external** URL (only if you enabled the external route).
- **Deployment URL** for the MCP server is the **predict** endpoint, for example:
- `<EXTERNAL_BASE_URL>/v1/models/<MODEL_NAME>:predict`
- `<EXTERNAL_BASE_URL>/v1/models/<MODEL_NAME>:predict`
where `<MODEL_NAME>` is the deployment’s **Resource name** (lowercase, no spaces). Example: `https://my-model-myproject.apps.example.com/v1/models/my-churn-model:predict`
- **Token** (if you enabled token auth): **Projects** → *your project* → **Deployments** → expand the deployment → use the **Token secret** value as `DEPLOYMENT_TOKEN`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies = [

[project.optional-dependencies]
dev = [
"pytest>=9.0.2,<10.0.0",
"pytest>=9.0.2,<10.0.0",
]

[tool.setuptools]
Expand Down
1 change: 0 additions & 1 deletion agents/crewai/websearch_agent/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ MODEL_ID=ollama/llama3.1:8b
# MLFLOW_WORKSPACE=default
# LLM_PROVIDER=litellm
# MLFLOW_TRACKING_AUTH= # Use Kubernetes service account for authentication (if running inside the cluster)

2 changes: 1 addition & 1 deletion agents/crewai/websearch_agent/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ requires-python = ">=3.12,<3.14"
dependencies = [
"fastapi>=0.135.1",
"uvicorn[standard]>=0.41.0",
"crewai[litellm]>=1.11.0",
"crewai[litellm]>=1.11.0",
"litellm!=1.82.7,!=1.82.8", # Block compromised PyPI releases
"python-dotenv>=1.1.1,<1.2.0", # CrewAI pins ~=1.1.1
"setuptools>=80.9.0,<82.0.0",
Expand Down
2 changes: 1 addition & 1 deletion agents/google/adk/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ API_KEY=not-needed-for-local-development
#PORT=

## Deployment Configuration (for OpenShift/Kubernetes)
#CONTAINER_IMAGE=
#CONTAINER_IMAGE=
Original file line number Diff line number Diff line change
Expand Up @@ -2283,4 +2283,4 @@
"action_name": null,
"action_description": null,
"access_type": "PRIVATE"
}
}
2 changes: 1 addition & 1 deletion agents/langgraph/agentic_rag/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
2 changes: 1 addition & 1 deletion agents/langgraph/agentic_rag/data/sample_knowledge.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ Best Practices for RAG Systems
- Track retrieval quality metrics
- Monitor generation quality
- Log and analyze user feedback
- A/B test different configurations
- A/B test different configurations
2 changes: 1 addition & 1 deletion agents/langgraph/react_agent/LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
MIT License

Copyright (c) 2026
Copyright (c) 2026
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Suggested change
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.

Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,4 @@
</script>

</body>
</html>
</html>
2 changes: 1 addition & 1 deletion agents/langgraph/react_with_database_memory/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ __pycache__
.venv
dist
config.toml
inference_engine_cache/
inference_engine_cache/
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,4 @@
</script>

</body>
</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ where = ["src"]

[build-system]
requires = ["setuptools>=80.9.0"]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"
2 changes: 1 addition & 1 deletion agents/llamaindex/websearch_agent/LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
MIT License

Copyright (c) 2026
Copyright (c) 2026
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Suggested change
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.

Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,4 @@
</script>

</body>
</html>
</html>
2 changes: 1 addition & 1 deletion agents/llamaindex/websearch_agent/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ where = ["src"]

[build-system]
requires = ["setuptools>=80.9.0"]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ MODEL_ID=gpt-4o-mini
# MLFLOW_TRACKING_INSECURE_TLS=
# MLFLOW_WORKSPACE=default
# MLFLOW_TRACKING_AUTH= # Use Kubernetes service account for authentication (if running inside the cluster)

2 changes: 1 addition & 1 deletion agents/vanilla_python/openai_responses_agent/LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
MIT License

Copyright (c) 2026
Copyright (c) 2026
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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Suggested change
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.

Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,4 @@
</script>

</body>
</html>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ where = ["src"]

[build-system]
requires = ["setuptools>=80.9.0"]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"
Loading
Loading