Skip to content

Commit 4b57980

Browse files
authored
Merge pull request #1270 from dbfixtures/coderabbitai
Add coderabbit configuration
2 parents b83f0a7 + 3d45b41 commit 4b57980

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

.coderabbit.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
language: en-GB
2+
reviews:
3+
path_instructions:
4+
- path: "newsfragments/*.rst"
5+
instructions: |
6+
Validate newsfragment files:
7+
1. Read valid types from [tool.towncrier.fragment] in pyproject.toml
8+
2. Filename must follow the pattern: [number].[type].rst OR +[hash].[type].rst where:
9+
- [number] is an issue number or PR number
10+
- [type] must be one of the types defined in towncrier configuration
11+
3. Content must be a clear, concise description of the change
12+
4. Content should be suitable for inclusion in CHANGES.rst
13+
5. Verify the type matches the nature of the change based on towncrier type definitions
14+
6. Flag any files with invalid types or malformed filenames
15+
7. Check that the description is meaningful (not just "fix" or "update")
16+
17+
pre_merge_checks:
18+
custom_checks:
19+
- name: "Newsfragment Check"
20+
mode: "warning"
21+
instructions: |
22+
Check if a newsfragment file has been added to the newsfragments/ directory.
23+
Read the towncrier configuration from pyproject.toml to determine valid newsfragment types.
24+
If no newsfragment is present, suggest which type should be added based on the PR changes.
25+
Suggest the filename format: [issue_or_pr_number].[type].rst
26+
Remind contributors to use: `pipenv run towncrier create [number].[type].rst`
27+
Skip the check if the PR only updates existing newsfragments or is a trivial change.

.github/workflows/diagram.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,12 @@ jobs:
1717
- name: Install Mermaid CLI
1818
run: npm install -g @mermaid-js/mermaid-cli
1919

20-
- name: Render Diagram
21-
run: mmdc -p docs/puppeteer-config.json -i docs/architecture.mmd -o docs/images/architecture.svg -t neutral
20+
- name: Render Diagrams
21+
run: |
22+
for file in docs/*.mmd; do
23+
base="$(basename "${file}" .mmd)"
24+
mmdc -p docs/puppeteer-config.json -i "${file}" -o "docs/images/${base}.svg" -t neutral
25+
done
2226
2327
- name: Commit and Push
2428
uses: stefanzweifel/git-auto-commit-action@v7

newsfragments/+4593101b.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add coderabbitai configuration with instructions to keep an eye for newsfragments.

newsfragments/+ba8eaaf7.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixes for diagram workflow.

0 commit comments

Comments
 (0)