Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c6db32e

Browse files
committed
Add exceptions for arktype, execa, and highland to prevent them from being flagged by unhandled pipe error query
1 parent 15ff7cb commit c6db32e

7 files changed

Lines changed: 21 additions & 6 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/javascript-all
4+
extensible: typeModel
5+
data:
6+
- ["NonNodeStream", "arktype", "Fuzzy"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/javascript-all
4+
extensible: typeModel
5+
data:
6+
- ["NonNodeStream", "execa", "Fuzzy"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/javascript-all
4+
extensible: typeModel
5+
data:
6+
- ["NonNodeStream", "highland", "Fuzzy"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { type } from 'arktype';
22

3-
type.string.pipe(Number) // $SPURIOUS:Alert
3+
type.string.pipe(Number);

javascript/ql/test/query-tests/Quality/UnhandledStreamPipe/execa.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const execa = require('execa');
44
const first = execa('node', ['empty.js']);
55
const second = execa('node', ['stdin.js']);
66

7-
first.stdout.pipe(second.stdin); // $SPURIOUS:Alert
7+
first.stdout.pipe(second.stdin);
88

99
const {stdout} = await second;
1010
console.log(stdout);

javascript/ql/test/query-tests/Quality/UnhandledStreamPipe/highland.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ highland(fs.createReadStream('input.txt'))
55
.map(line => {
66
if (line.length === 0) throw new Error('Empty line');
77
return line;
8-
}).pipe(fs.createWriteStream('output.txt')); // $SPURIOUS:Alert
8+
}).pipe(fs.createWriteStream('output.txt'));

javascript/ql/test/query-tests/Quality/UnhandledStreamPipe/test.expected

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
| arktype.js:3:1:3:24 | type.st ... Number) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
2-
| execa.js:7:3:7:33 | first.s ... .stdin) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
3-
| highland.js:4:1:8:45 | highlan ... .txt')) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
41
| rxjsStreams.js:19:3:19:28 | z.optio ... k("x")) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
52
| test.js:4:5:4:28 | stream. ... nation) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |
63
| test.js:19:5:19:17 | s2.pipe(dest) | Stream pipe without error handling on the source stream. Errors won't propagate downstream and may be silently dropped. |

0 commit comments

Comments
 (0)