Skip to content

Commit aa841d5

Browse files
Copilot review instructions for IPA rules (#646)
Co-authored-by: Wojciech Trocki <[email protected]>
1 parent 35aabb5 commit aa841d5

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/copilot-instructions.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copilot Review Guidelines
2+
3+
## IPA Developement guidelines
4+
5+
These guidelines should be applied only to changes within the following folders:
6+
- `tools/spectral/ipa/`
7+
8+
Ensure that the changes being reviewed or implemented are within these specified folders. If changes are outside these folders, these guidelines do not apply.
9+
10+
11+
12+
## Role and Expertise
13+
When reviewing IPA rule implementations, act as a Node.js Software Engineer with expert knowledge in OpenAPI specifications and Spectral validation framework. Focus on ensuring rules are functional and well-documented.
14+
15+
## Review Checklist
16+
When reviewing IPA rule implementations, verify:
17+
- All rules are set at warning level
18+
- Exceptions are properly placed on the given object
19+
- Rules follow the proper format (order of checks and method names)
20+
- Appropriate use of resolved or unresolved Spectral documents
21+
- No redundant JavaScript checks for undefined inputs
22+
- Code follows latest Node.js best practices
23+
24+
## Implementation Guidelines
25+
Ensure the rule follows this structure:
26+
- Proper determination of component level for rule processing
27+
- Consistent collection of exceptions, adoptions, and violations at the same component level
28+
- Appropriate use of helper functions:
29+
- `collectException(object, ruleName, jsonPath)` for exceptions
30+
- `collectAdoption(jsonPath, ruleName)` for adoptions
31+
- `collectAndReturnViolation(jsonPath, ruleName, errorData)` for violations
32+
- Check #file:tools/spectral/ipa/rulesets/functions/utils/collectionUtils.js for examples
33+
34+
## Context
35+
36+
Please refer to the example IPA (OpenAPI standard) implementation:
37+
- #file:tools/spectral/ipa/__tests__/IPA102CollectionIdentifierCamelCase.test.js
38+
- #file:tools/spectral/ipa/rulesets/IPA-102.yaml
39+
- #file:/tools/spectral/ipa/rulesets/functions/IPA102CollectionIdentifierCamelCase.js

0 commit comments

Comments
 (0)