Skip to content

Commit ae600b5

Browse files
committed
Remove empty string in arguments when linting
1 parent 9404b14 commit ae600b5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/features/linter-provider.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,15 @@ export default class FortranLintingProvider {
2828
let includePaths = this.getIncludePaths();
2929
let command = this.getGfortranPath();
3030

31-
let childProcess = cp.spawn(command, [
32-
...args,
33-
getIncludeParams(includePaths), // include paths
34-
textDocument.fileName]);
31+
let argList = [
32+
...args,
33+
getIncludeParams(includePaths), // include paths
34+
textDocument.fileName
35+
];
36+
37+
argList = argList.map( arg => arg.trim()).filter(arg => arg !== "");
38+
39+
let childProcess = cp.spawn(command, argList)
3540

3641
if (childProcess.pid) {
3742
childProcess.stdout.on('data', (data: Buffer) => {
@@ -41,8 +46,6 @@ export default class FortranLintingProvider {
4146
decoded += data;
4247
});
4348
childProcess.stderr.on('end', () => {
44-
let decodedOriginal = decoded;
45-
4649
let matchesArray: string[];
4750
while ((matchesArray = errorRegex.exec(decoded)) !== null) {
4851
let elements: string[] = matchesArray.slice(1); // get captured expressions

0 commit comments

Comments
 (0)