Skip to content

Commit

Permalink
Prepend default line length arguments instead of appending them
Browse files Browse the repository at this point in the history
Currently, the default line length arguments for the gfortran linter are appended AFTER the users extraArgs. Since in gfortran, the last occurrence of an argument that is passed multiple times will be taken, the default line length arguments will always overwrite what a user has explicitly set in extraArgs.

By prepending the default line length arguments instead, a user should now have the possibility to overwrite the default.
  • Loading branch information
albertziegenhagel committed Jun 21, 2023
1 parent fc0419d commit 1b6f4c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lint/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ export class FortranLintingProvider {
if (this.linter.name === 'gfortran') {
const ln: number = config.get('fortls.maxLineLength');
const lnStr: string = ln === -1 ? 'none' : ln.toString();
args.push(`-ffree-line-length-${lnStr}`, `-ffixed-line-length-${lnStr}`);
args.unshift(`-ffree-line-length-${lnStr}`, `-ffixed-line-length-${lnStr}`);
}
if (args.length > 0) this.logger.debug(`[lint] arguments:`, args);

Expand Down

0 comments on commit 1b6f4c1

Please sign in to comment.