Skip to content

Commit b4652a6

Browse files
authored
Merge pull request #35 from istreamlabs/noun-special-exception
feat: add another specialized exception to noun
2 parents a0350a2 + cf327f3 commit b4652a6

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ It's also possible to set it to `warn` or `info`.
6969

7070
The `extends` field is automatically added (or appended to) by the linter script to inject the iSP ruleset into your config.
7171

72+
### Local Development
73+
74+
1. Install `node 13.14.0` locally.
75+
2. Run `npm run build` to compile the `isp-functions`.
76+
3. Run `node ./entrypoint.js <PATH_TO_OPENAPI_SPEC>` to run the linter.
77+
78+
The `build` command may need to be re-run to pick up changes made to some of the `isp-functions`.
79+
80+
#### Tests
81+
82+
```sh
83+
# Compile the isp-functions
84+
npm run build
85+
86+
# Run test
87+
npm run test
88+
```
89+
7290
## License
7391

7492
Copyright © 2020 iStreamPlanet Co., LLC

fixtures/lint/noun-pass.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,29 @@ paths:
6666
responses:
6767
'204':
6868
description: Response description
69+
/foos/{fooId}/bars/{barId}/preview/watch:
70+
get:
71+
summary: Test operation
72+
description: Test operation description
73+
operationId: test-preview
74+
tags:
75+
- Test
76+
parameters:
77+
- name: fooId
78+
in: path
79+
required: true
80+
description: some parameter
81+
schema:
82+
type: string
83+
pattern: /[a-z]+/
84+
- name: barId
85+
in: path
86+
required: true
87+
description: some parameter
88+
schema:
89+
type: string
90+
pattern: /[a-z]+/
91+
responses:
92+
'204':
93+
description: Response description
94+

isp-functions/noun-deps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = targetValue => {
2929
// Split into path pieces ignoring blank/empty ones and params.
3030
let pieces = targetValue.split('/').filter(i => !!i);
3131

32-
if ((pieces.length === 1 && pieces[0] === 'search') || pieces[0] === 'me' || pieces[0] === 'cust') {
32+
if ((pieces.length === 1 && pieces[0] === 'search') || pieces[0] === 'me' || pieces[0] === 'cust' || (pieces.length === 6 && pieces[4] === 'preview')) {
3333
// Top-level exceptions. Skip.
3434
return;
3535
}

0 commit comments

Comments
 (0)