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

Commit

Permalink
Merge pull request #647 from coneybeare/wrap-document-path
Browse files Browse the repository at this point in the history
Wrap documentPath.fsPath in single quotes to support file paths with spaces
  • Loading branch information
wingrunr21 authored Oct 15, 2020
2 parents d281a30 + d432fee commit 70de88e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/language-server-ruby/src/formatters/RuboCop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class RuboCop extends BaseFormatter {

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

Expand Down
2 changes: 1 addition & 1 deletion packages/language-server-ruby/src/formatters/Rufo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export default class Rubocop extends BaseFormatter {

get args(): string[] {
const documentPath = URI.parse(this.document.uri);
return [`--filename=${documentPath.fsPath}`, '-x'];
return [`--filename='${documentPath.fsPath}'`, '-x'];
}
}
2 changes: 1 addition & 1 deletion packages/language-server-ruby/src/formatters/Standard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default class Standard extends RuboCop {

get args(): string[] {
const documentPath = URI.parse(this.document.uri);
let args = ['-s', documentPath.fsPath, '--fix'];
let args = ['-s', `'${documentPath.fsPath}'`, '--fix'];
return args;
}
}
2 changes: 1 addition & 1 deletion packages/language-server-ruby/src/linters/Reek.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class Reek extends BaseLinter {

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

protected processResults(data): Diagnostic[] {
Expand Down
2 changes: 1 addition & 1 deletion packages/language-server-ruby/src/linters/RuboCop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class RuboCop extends BaseLinter {

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

0 comments on commit 70de88e

Please sign in to comment.