mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-03 20:30:41 +08:00
docs: convert info box to standard heading for hierarchical best practices setup
This commit is contained in:
@ -218,73 +218,73 @@ For organizations managing multiple repositories with different requirements, Qo
|
|||||||
2. **Groups of repositories**: Repositories can be mapped to shared group-level best practices for consistent standards across similar projects
|
2. **Groups of repositories**: Repositories can be mapped to shared group-level best practices for consistent standards across similar projects
|
||||||
3. **Monorepos with subprojects**: Large monorepos can have both repository-level and subproject-level best practices, with automatic path-based matching
|
3. **Monorepos with subprojects**: Large monorepos can have both repository-level and subproject-level best practices, with automatic path-based matching
|
||||||
|
|
||||||
???- info "Setting up global hierarchical best practices"
|
#### Setting up global hierarchical best practices
|
||||||
|
|
||||||
1\. Create a new repository named `pr-agent-settings` in your organization/workspace.
|
1\. Create a new repository named `pr-agent-settings` in your organization/workspace.
|
||||||
|
|
||||||
2\. Build the folder hierarchy in your `pr-agent-settings` repository, for example:
|
2\. Build the folder hierarchy in your `pr-agent-settings` repository, for example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pr-agent-settings/
|
pr-agent-settings/
|
||||||
├── metadata.yaml # Maps repos/folders to best practice paths
|
├── metadata.yaml # Maps repos/folders to best practice paths
|
||||||
└── codebase_standards/ # Root for all best practice definitions
|
└── codebase_standards/ # Root for all best practice definitions
|
||||||
├── global/ # Global rules, inherited widely
|
├── global/ # Global rules, inherited widely
|
||||||
│ └── best_practices.md
|
│ └── best_practices.md
|
||||||
├── groups/ # For groups of repositories
|
├── groups/ # For groups of repositories
|
||||||
│ ├── frontend_repos/
|
│ ├── frontend_repos/
|
||||||
│ │ └── best_practices.md
|
│ │ └── best_practices.md
|
||||||
│ ├── backend_repos/
|
│ ├── backend_repos/
|
||||||
│ │ └── best_practices.md
|
│ │ └── best_practices.md
|
||||||
│ └── ...
|
│ └── ...
|
||||||
├── qodo-merge/ # For standalone repositories
|
├── qodo-merge/ # For standalone repositories
|
||||||
│ └── best_practices.md
|
│ └── best_practices.md
|
||||||
├── qodo-monorepo/ # For monorepo-specific rules
|
├── qodo-monorepo/ # For monorepo-specific rules
|
||||||
│ ├── best_practices.md # Root level monorepo rules
|
│ ├── best_practices.md # Root level monorepo rules
|
||||||
│ ├── qodo-github/ # Subproject best practices
|
│ ├── qodo-github/ # Subproject best practices
|
||||||
│ │ └── best_practices.md
|
│ │ └── best_practices.md
|
||||||
│ └── qodo-gitlab/ # Another subproject
|
│ └── qodo-gitlab/ # Another subproject
|
||||||
│ └── best_practices.md
|
│ └── best_practices.md
|
||||||
└── ... # More repositories
|
└── ... # More repositories
|
||||||
```
|
```
|
||||||
|
|
||||||
3\. Define the metadata file `metadata.yaml` that maps your repositories to their relevant best practices paths, for example:
|
3\. Define the metadata file `metadata.yaml` that maps your repositories to their relevant best practices paths, for example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Standalone repos
|
# Standalone repos
|
||||||
qodo-merge:
|
qodo-merge:
|
||||||
|
best_practices_paths:
|
||||||
|
- "qodo-merge"
|
||||||
|
|
||||||
|
# Group-associated repos
|
||||||
|
repo_b:
|
||||||
|
best_practices_paths:
|
||||||
|
- "groups/backend_repos"
|
||||||
|
|
||||||
|
# Multi-group repos
|
||||||
|
repo_c:
|
||||||
|
best_practices_paths:
|
||||||
|
- "groups/frontend_repos"
|
||||||
|
- "groups/backend_repos"
|
||||||
|
|
||||||
|
# Monorepo with subprojects
|
||||||
|
qodo-monorepo:
|
||||||
|
best_practices_paths:
|
||||||
|
- "qodo-monorepo"
|
||||||
|
monorepo_subprojects:
|
||||||
|
qodo-github:
|
||||||
best_practices_paths:
|
best_practices_paths:
|
||||||
- "qodo-merge"
|
- "qodo-monorepo/qodo-github"
|
||||||
|
qodo-gitlab:
|
||||||
# Group-associated repos
|
|
||||||
repo_b:
|
|
||||||
best_practices_paths:
|
best_practices_paths:
|
||||||
- "groups/backend_repos"
|
- "qodo-monorepo/qodo-gitlab"
|
||||||
|
```
|
||||||
|
|
||||||
# Multi-group repos
|
4\. Set the following configuration in your global configuration file:
|
||||||
repo_c:
|
|
||||||
best_practices_paths:
|
|
||||||
- "groups/frontend_repos"
|
|
||||||
- "groups/backend_repos"
|
|
||||||
|
|
||||||
# Monorepo with subprojects
|
```toml
|
||||||
qodo-monorepo:
|
[best_practices]
|
||||||
best_practices_paths:
|
enable_global_best_practices = true
|
||||||
- "qodo-monorepo"
|
```
|
||||||
monorepo_subprojects:
|
|
||||||
qodo-github:
|
|
||||||
best_practices_paths:
|
|
||||||
- "qodo-monorepo/qodo-github"
|
|
||||||
qodo-gitlab:
|
|
||||||
best_practices_paths:
|
|
||||||
- "qodo-monorepo/qodo-gitlab"
|
|
||||||
```
|
|
||||||
|
|
||||||
4\. Set the following configuration in your global configuration file:
|
|
||||||
|
|
||||||
```toml
|
|
||||||
[best_practices]
|
|
||||||
enable_global_best_practices = true
|
|
||||||
```
|
|
||||||
|
|
||||||
???- info "Best practices priority and fallback behavior"
|
???- info "Best practices priority and fallback behavior"
|
||||||
|
|
||||||
@ -312,21 +312,32 @@ For organizations managing multiple repositories with different requirements, Qo
|
|||||||
- **Monorepo subproject matching**: For monorepos, Qodo Merge automatically matches PR file paths against subproject paths to apply relevant best practices
|
- **Monorepo subproject matching**: For monorepos, Qodo Merge automatically matches PR file paths against subproject paths to apply relevant best practices
|
||||||
- **Multiple group inheritance**: Repositories can inherit from multiple groups, and all applicable best practices are combined
|
- **Multiple group inheritance**: Repositories can inherit from multiple groups, and all applicable best practices are combined
|
||||||
|
|
||||||
#### Best practices for multiple languages
|
[//]: # (#### Best practices for multiple languages)
|
||||||
|
|
||||||
For a git organization working with multiple programming languages, you can maintain a centralized global `best_practices.md` file containing language-specific guidelines.
|
[//]: # ()
|
||||||
When reviewing pull requests, Qodo Merge automatically identifies the programming language and applies the relevant best practices from this file.
|
[//]: # (For a git organization working with multiple programming languages, you can maintain a centralized global `best_practices.md` file containing language-specific guidelines.)
|
||||||
|
|
||||||
To do this, structure your `best_practices.md` file using the following format:
|
[//]: # (When reviewing pull requests, Qodo Merge automatically identifies the programming language and applies the relevant best practices from this file.)
|
||||||
|
|
||||||
```
|
[//]: # ()
|
||||||
# [Python]
|
[//]: # (To do this, structure your `best_practices.md` file using the following format:)
|
||||||
...
|
|
||||||
# [Java]
|
[//]: # ()
|
||||||
...
|
[//]: # (```)
|
||||||
# [JavaScript]
|
|
||||||
...
|
[//]: # (# [Python])
|
||||||
```
|
|
||||||
|
[//]: # (...)
|
||||||
|
|
||||||
|
[//]: # (# [Java])
|
||||||
|
|
||||||
|
[//]: # (...)
|
||||||
|
|
||||||
|
[//]: # (# [JavaScript])
|
||||||
|
|
||||||
|
[//]: # (...)
|
||||||
|
|
||||||
|
[//]: # (```)
|
||||||
|
|
||||||
#### Dedicated label for best practices suggestions
|
#### Dedicated label for best practices suggestions
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user