Skip to content

Eslint formatting #261

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

Closed
wants to merge 14 commits into from
20 changes: 20 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**@type {import('eslint').Linter.Config} */
// eslint-disable-next-line no-undef
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
'semi': [2, "always"],
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-non-null-assertion': 0,
}
};
2 changes: 2 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: yarn run compile
- run: yarn test
- run: yarn test:grammar


23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## Fixed

- Extension now activates for `FortranFixedForm`
([#257](https://github.com/krvajal/vscode-fortran-support/issues/257))
- Linting is now operational for `FortranFixedForm`
([#258](https://github.com/krvajal/vscode-fortran-support/issues/258))

## Changed

- Renamed the Fixed Format Format language from `fortran_fixed-form` to
`FortranFixedForm`, an alias has been added for backwards compatibility
([#259](https://github.com/krvajal/vscode-fortran-support/issues/259))

### Added

- Adds support for formatting with `findent` and `fprettify`
([#29](https://github.com/krvajal/vscode-fortran-support/issues/29))
- Adds prompts for installing Fortran IntelliSense and fortran-language-server

### Removed

- Removes `paths.js` for detecting binaries in favour of `which`

## [2.3.1]

### Fixed
Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Code autocompletion (beta)
- Symbols provider
- Debugger, uses Microsoft's [C/C++ extension](https://github.com/Microsoft/vscode-cpptools)
- Formatting with [findent](https://github.com/gnikit/findent-pypi) or [fprettify](https://github.com/pseewald/fprettify)

![symbol_nav](./doc/symbol_nav.png)

Expand Down Expand Up @@ -139,6 +140,40 @@ More details about how to setup the debugger can be found in Microsoft's website
}
```

## Formatting

Two formatters are supported [`findent`](https://github.com/gnikit/findent-pypi)
and [`fprettify`](https://github.com/pseewald/fprettify). Both of them can be
installed with `pip` automatically through the extension.

The formatter is controlled by the user option

```json
{
"fortran.formatting.formatter": "Disabled" | "findent" | "fprettify",
}
```

Additional arguments to the formatter can be input using

```json
{
"fortran.formatting.args":, ["-Cn", "-Rr"]
}
```

If the formatter is not present in the `PATH` its location can be input with

```json
{
"fortran.formattting.path": "/custom-path-to-formatter-binary",
}
```

### NOTE: About `findent`

`findent` can also be used to generate dependency files for a project.

## Requirements

For the linter to work you need to have `gfortran` on your path, or wherever you configure it to be.
Expand Down
Loading