Skip to content

Commit

Permalink
fix: update schema to allow GHSA IDs (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath authored Jul 26, 2022
1 parent 4271ca5 commit aa5b6ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"type": "array",
"items": {
"type": "string",
"pattern": "^\\d+\\|((?:@[a-z\\d*~-][a-z\\d*._~-]*/)?[a-z\\d~-][a-z\\d._~-]*>)*?((?:@[a-z\\d*~-][a-z\\d*._~-]*/)?[a-z\\d~-][a-z\\d._~-]*)$"
"pattern": "^[\\w-]+\\|((?:@[a-z\\d*~-][a-z\\d*._~-]*/)?[a-z\\d~-][a-z\\d._~-]*>)*?((?:@[a-z\\d*~-][a-z\\d*._~-]*/)?[a-z\\d~-][a-z\\d._~-]*)$"
}
}
},
Expand Down
11 changes: 6 additions & 5 deletions test/src/schema.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ describe('config schema', () => {
'1|a>',
'1|a>b>',
'1|a>>b>>c',
'1|abc> asasdf1|df>asdf>',
'abc|gulp>vinyl-fs>glob-stream>glob>minimatch',
'abc|ember-cli>testem>socket.io>socket.io-parser>debug',
'abc|socket.io>socket.io-parser'
'1|abc> asasdf1|df>asdf>'
])('fails "%s"', invalidPath => {
const invalidPathError: ErrorObject = {
keyword: 'pattern',
Expand Down Expand Up @@ -61,7 +58,11 @@ describe('config schema', () => {
'534|socket.io-parser',
'1523|@commitlint/cli>@commitlint/lint>@commitlint/rules>@commitlint/ensure',
'1523|@commitlint/cli',
'1523|meow>@commitlint/cli'
'1523|meow>@commitlint/cli',
'GHSA-566m-qj78-rww5|css-loader>cssnano>autoprefixer>postcss',
'abc|gulp>vinyl-fs>glob-stream>glob>minimatch',
'abc|ember-cli>testem>socket.io>socket.io-parser>debug',
'abc|socket.io>socket.io-parser'
])('allows "%s"', validPath => {
expect(validate({ ignore: [validPath] })).toStrictEqual([]);
});
Expand Down

0 comments on commit aa5b6ef

Please sign in to comment.