Skip to content

Commit

Permalink
lizard: add 'extraArgs' argument (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshihideShirai authored Sep 24, 2022
1 parent 9560349 commit 7b60af3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,14 @@
"type": "string",
"description": "This option allows you to override the executable called when using lizard",
"default": "lizard"
},
"c-cpp-flylint.lizard.extraArgs": {
"type": [
"array",
"null"
],
"default": null,
"description": "Extra verbatim command-line arguments to include on the lizard command-line invocation."
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion server/src/linters/lizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class Lizard extends Linter {
protected buildCommandLine(fileName: string, _tmpFileName: string): string[] {
let args = [this.executable]
.concat(['--warnings_only'])
.concat([]);
.concat(this.settings['c-cpp-flylint'].lizard.extraArgs || []);

args.push(fileName);

Expand Down
1 change: 1 addition & 0 deletions server/src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export interface FlylintSettings {
lizard: {
enable: boolean;
executable: string;
extraArgs: string[] | null;
}
}

Expand Down
3 changes: 2 additions & 1 deletion specs/mock-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ export const defaultConfig: Settings = {

lizard: {
enable: true,
executable: 'lizard'
executable: 'lizard',
extraArgs: null,
}
}
};

0 comments on commit 7b60af3

Please sign in to comment.