Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit d432fee

Browse files
committed
Wrap documentPath.fsPath in single quotes to support file paths with spaces
1 parent 1124efc commit d432fee

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

packages/language-server-ruby/src/formatters/RuboCop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default class RuboCop extends BaseFormatter {
1313

1414
get args(): string[] {
1515
const documentPath = URI.parse(this.document.uri);
16-
const args = ['-s', documentPath.fsPath, '-a'];
16+
const args = ['-s', `'${documentPath.fsPath}'`, '-a'];
1717
return args;
1818
}
1919

packages/language-server-ruby/src/formatters/Rufo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ export default class Rubocop extends BaseFormatter {
99

1010
get args(): string[] {
1111
const documentPath = URI.parse(this.document.uri);
12-
return [`--filename=${documentPath.fsPath}`, '-x'];
12+
return [`--filename='${documentPath.fsPath}'`, '-x'];
1313
}
1414
}

packages/language-server-ruby/src/formatters/Standard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default class Standard extends RuboCop {
99

1010
get args(): string[] {
1111
const documentPath = URI.parse(this.document.uri);
12-
let args = ['-s', documentPath.fsPath, '--fix'];
12+
let args = ['-s', `'${documentPath.fsPath}'`, '--fix'];
1313
return args;
1414
}
1515
}

packages/language-server-ruby/src/linters/Reek.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default class Reek extends BaseLinter {
2727

2828
get args(): string[] {
2929
const documentPath = URI.parse(this.document.uri);
30-
return ['-f', 'json', '--stdin-filename', documentPath.fsPath];
30+
return ['-f', 'json', '--stdin-filename', `'${documentPath.fsPath}'`];
3131
}
3232

3333
protected processResults(data): Diagnostic[] {

packages/language-server-ruby/src/linters/RuboCop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default class RuboCop extends BaseLinter {
5858

5959
get args(): string[] {
6060
const documentPath = URI.parse(this.document.uri);
61-
let args = ['-s', documentPath.fsPath, '-f', 'json'];
61+
let args = ['-s', `'${documentPath.fsPath}'`, '-f', 'json'];
6262
if (this.lintConfig.rails) args.push('-R');
6363
if (this.lintConfig.forceExclusion) args.push('--force-exclusion');
6464
if (this.lintConfig.lint) args.push('-l');

0 commit comments

Comments
 (0)