Skip to content

Commit

Permalink
Merge pull request #924 from albertziegenhagel/fix-line-length-flags
Browse files Browse the repository at this point in the history
Allow user to overwrite line-length flags for gfortran linter
  • Loading branch information
gnikit committed Jun 22, 2023
2 parents fc0419d + 3485ae0 commit e02a6b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

- Fixed bug where specifying `-ffree-line-length-X` and `-ffixed-line-length-X`
as `linter.extraArgs` would be overridden by the default behaviour of `fortls`
([#925](https://github.com/fortran-lang/vscode-fortran-support/issues/925))
- Fixed bug where linter would not use the correct Fortran file association
if the extension was part of the default extensions of another Fortran lang ID
([#904](https://github.com/fortran-lang/vscode-fortran-support/issues/904))
Expand Down
4 changes: 3 additions & 1 deletion src/lint/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,9 @@ 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}`);
// Prepend via `unshift` to make sure user defined flags overwrite
// the default ones we provide here.
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 e02a6b9

Please sign in to comment.