Skip to content

Commit b4a92c0

Browse files
authored
Merge pull request #725 from linear-b/improve-ai-guidelines-examples
Improve instructions for adding code review guidelines
2 parents ebf29c9 + a214ea2 commit b4a92c0

File tree

6 files changed

+55
-12
lines changed

6 files changed

+55
-12
lines changed

docs/automation-actions.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,16 @@ automations:
304304
args:
305305
approve_on_LGTM: {{ APPROVE_PR_ON_LGTM }} # optional arg, you can remove it
306306
guidelines: {{ GUIDELINES | dump }}
307-
...
308-
...
309-
# Define variables
310307
311-
APPROVE_PR_ON_LGTM: false # Add conditions for PR approvals. For example - allow approval only for specific users
308+
# Define variables
309+
# Add conditions for PR approvals. For example - allow approval only for specific users
310+
APPROVE_PR_ON_LGTM: false
311+
# Add your prompts to the review
312312
GUIDELINES: |
313313
- Don't comment on using outdated dependencies
314-
314+
- In Javascript
315+
- Make sure camelCase is used for variable names
316+
- Make sure PascalCase is used for class names
315317
```
316318

317319
The following files are automatically excluded from the code review.

docs/automations/integrations/LinearBAI/code-review/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Use LinearB's AI with the [`code-review`](/automation-actions/#code-review) acti
2222
Automation Actions:
2323

2424
* Perform an AI-driven code review and append the review comments to the PR.
25+
* Use `guidelines` to add your prompts to the team or org review
2526

2627
=== "For GitHub"
2728

@@ -58,8 +59,21 @@ Use LinearB's AI with the [`code-review`](/automation-actions/#code-review) acti
5859
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm){ .md-button }
5960
</span>
6061
</div>
62+
63+
!!! tip "`./REVIEW_RULES.md` example"
64+
65+
This file should be created in your repo root:
66+
67+
```
68+
1. Do not comment on missing documentation.
69+
2. Do not comment on missing tests.
70+
3. For JavaScript code, enforce using camelCase for variables and functions.
71+
```
72+
6173
<!-- --8<-- [end:example]-->
6274

75+
76+
6377
## Additional Resources
6478

6579
--8<-- "docs/snippets/general.md"

docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,14 @@ automations:
99
- action: code-review@v1
1010
args:
1111
approve_on_LGTM: {{ APPROVE_PR_ON_LGTM }} # optional arg, you can remove it
12+
guidelines: {{ GUIDELINES }}
1213

13-
APPROVE_PR_ON_LGTM: false # you can add conditions for PR approvals. For example - allowing approvals only for specific users
14+
# Define variables
15+
# Add conditions for PR approvals. For example - allow approval only for specific users
16+
APPROVE_PR_ON_LGTM: false
17+
18+
# Add `guidelines` to add your prompts to the review, you can have org wide instructions
19+
# by placing the `REVIEW_RULES.md` in the `cm` repo or team level instructions by adding it to
20+
# the team repo.
21+
# Note: To when the file is in the `cm` repo, use this example: `../cm/REVIEW_RULES.md`
22+
GUIDELINES: {{ "./REVIEW_RULES.md" | readFile() | dump }}

docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,14 @@ automations:
1010
- action: code-review@v1
1111
args:
1212
approve_on_LGTM: {{ APPROVE_PR_ON_LGTM }} # optional arg, you can remove it
13+
guidelines: {{ GUIDELINES }}
1314

14-
APPROVE_PR_ON_LGTM: false # you can add conditions for PR approvals. For example - allowing approvals only for specific users
15+
# Define variables
16+
# Add conditions for PR approvals. For example - allow approval only for specific users
17+
APPROVE_PR_ON_LGTM: false
18+
19+
# Add `guidelines` to add your prompts to the review, you can have org wide instructions
20+
# by placing the `REVIEW_RULES.md` in the `cm` repo or team level instructions by adding it to
21+
# the team repo.
22+
# Note: To when the file is in the `cm` repo, use this example: `../cm/REVIEW_RULES.md`
23+
GUIDELINES: {{ "./REVIEW_RULES.md" | readFile() | dump }}

docs/downloads/automation-library/integrations/LinearBAI/code-review.cm

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,14 @@ automations:
1414
- action: code-review@v1
1515
args:
1616
approve_on_LGTM: {{ APPROVE_PR_ON_LGTM }} # optional arg, you can remove it
17+
guidelines: {{ GUIDELINES }}
1718

18-
APPROVE_PR_ON_LGTM: false # you can add conditions for PR approvals. For example - allowing approvals only for specific users
19+
# Define variables
20+
# Add conditions for PR approvals. For example - allow approval only for specific users
21+
APPROVE_PR_ON_LGTM: false
22+
23+
# Add `guidelines` to add your prompts to the review, you can have org wide instructions
24+
# by placing the `REVIEW_RULES.md` in the `cm` repo or team level instructions by adding it to
25+
# the team repo.
26+
# Note: To when the file is in the `cm` repo, use this example: `../cm/REVIEW_RULES.md`
27+
GUIDELINES: {{ "./REVIEW_RULES.md" | readFile() | dump }}

docs/integrations/LB_AI.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ category: [quality, genai, copilot, tests, efficiency]
99

1010
## Automation Examples
1111

12-
### Add PR Description Using LinearB's AI :material-star-circle:
13-
14-
--8<-- "docs/automations/integrations/LinearBAI/describe-pr/README.md:example"
15-
1612
### Use LinearB's AI for a comprehensive Code Review :material-star-circle:
1713

1814
--8<-- "docs/automations/integrations/LinearBAI/code-review/README.md:example"
1915

16+
### Add PR Description Using LinearB's AI :material-star-circle:
17+
18+
--8<-- "docs/automations/integrations/LinearBAI/describe-pr/README.md:example"
19+
2020
## Additional Resources
2121

2222
--8<-- "docs/snippets/general.md"

0 commit comments

Comments
 (0)