Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user to overwrite line-length flags for gfortran linter #924

Merged
merged 2 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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