Skip to content

Commit 4dce501

Browse files
committed
CLOUDP-305862: IPA 106 documentation standard
1 parent f7ddc75 commit 4dce501

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

tools/spectral/ipa/__tests__/exceptionExtensionFormat.test.js renamed to tools/spectral/ipa/__tests__/IPA105exceptionExtensionFormat.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,25 @@ testRule('xgen-IPA-005-exception-extension-format', [
5151
errors: [
5252
{
5353
code: 'xgen-IPA-005-exception-extension-format',
54-
message: 'IPA exceptions must have a valid rule name and a reason. http://go/ipa/5',
54+
message: 'IPA exceptions must have a valid rule name and a reason. http://go/ipa-spectral#IPA-102',
5555
path: ['paths', '/path1', 'x-xgen-IPA-exception'],
5656
severity: DiagnosticSeverity.Warning,
5757
},
5858
{
5959
code: 'xgen-IPA-005-exception-extension-format',
60-
message: 'IPA exceptions must have a valid rule name and a reason. http://go/ipa/5',
60+
message: 'IPA exceptions must have a valid rule name and a reason. http://go/ipa-spectral#IPA-102',
6161
path: ['paths', '/path2', 'x-xgen-IPA-exception', 'xgen-IPA-100-rule-name'],
6262
severity: DiagnosticSeverity.Warning,
6363
},
6464
{
6565
code: 'xgen-IPA-005-exception-extension-format',
66-
message: 'IPA exceptions must have a valid rule name and a reason. http://go/ipa/5',
66+
message: 'IPA exceptions must have a valid rule name and a reason. http://go/ipa-spectral#IPA-102',
6767
path: ['paths', '/path3', 'x-xgen-IPA-exception', 'invalid-rule-name'],
6868
severity: DiagnosticSeverity.Warning,
6969
},
7070
{
7171
code: 'xgen-IPA-005-exception-extension-format',
72-
message: 'IPA exceptions must have a valid rule name and a reason. http://go/ipa/5',
72+
message: 'IPA exceptions must have a valid rule name and a reason. http://go/ipa-spectral#IPA-102',
7373
path: ['paths', '/path4', 'x-xgen-IPA-exception', 'xgen-IPA-100-rule-name'],
7474
severity: DiagnosticSeverity.Warning,
7575
},

tools/spectral/ipa/rulesets/IPA-005.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22
# http://go/ipa/5
33

44
functions:
5-
- exceptionExtensionFormat
5+
- IPA105ExceptionExtensionFormat
66

77
rules:
88
xgen-IPA-005-exception-extension-format:
9-
description: 'IPA exception extensions must follow the correct format. http://go/ipa/5'
10-
message: '{{error}} http://go/ipa/5'
9+
description: |
10+
IPA exception extensions must follow the correct format. http://go/ipa/5
11+
12+
##### Implementation details
13+
Rule checks for the following conditions:
14+
- Exception rule names must start with 'xgen-IPA-' prefix
15+
- Each exception must include a non-empty reason as a string
16+
- This rule itself does not allow exceptions
17+
message: '{{error}} http://go/ipa-spectral#IPA-102'
1118
severity: error
1219
given: '$..x-xgen-IPA-exception'
1320
then:
14-
function: 'exceptionExtensionFormat'
21+
function: 'IPA105ExceptionExtensionFormat'

tools/spectral/ipa/rulesets/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ Rule is based on [http://go/ipa/IPA-5](http://go/ipa/IPA-5).
1717
![error](https://img.shields.io/badge/error-red)
1818
IPA exception extensions must follow the correct format. http://go/ipa/5
1919

20+
##### Implementation details
21+
Rule checks for the following conditions:
22+
- Exception rule names must start with 'xgen-IPA-' prefix
23+
- Each exception must include a non-empty reason as a string
24+
- This rule itself does not allow exceptions
25+
26+
2027

2128

2229
### IPA-102

0 commit comments

Comments
 (0)