Skip to content

Commit e642012

Browse files
committed
Formats all files in the repo
The lint-stage hook sould now be able to work when we commit. If a commit fails then run `npm run lint-fix` to try and autofix and then `npm run format`. All of these actions should be run automatically via the git hook but I am listing the steps in case the hook fails.
1 parent 46a4dc3 commit e642012

29 files changed

+6052
-6220
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
#CONTRIBUTING
2-
---
3-
You *always* want to look at this file **before** contributing. In here you
1+
# #CONTRIBUTING
2+
3+
You _always_ want to look at this file **before** contributing. In here you
44
should find steps that you need to take to set up your development environment
55
as well as instructions for coding standards and contribution guidelines.
66

7-
87
## Setup instructions
9-
First of all, this is a Visual Studio Code extension that uses TypeScript and tools based on [Node.js](https://nodejs.org/en/) with dependencies from npm. So you will need to have Node installed on your `$PATH`.
8+
9+
First of all, this is a Visual Studio Code extension that uses TypeScript and tools based on [Node.js](https://nodejs.org/en/) with dependencies from npm. So you will need to have Node installed on your `$PATH`.
10+
1011
1. Fork the repo
1112
2. Clone your fork
1213
3. Create a branch
13-
4. Run `npm install`
14-
14+
4. Run `yarn install`
15+
5. To test the extension run `yarn test:grammar && yarn test`

README.md

Lines changed: 35 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,36 +24,33 @@
2424

2525
You can control the include paths to be used by the linter with the `fortran.includePaths` setting.
2626

27-
``` jsonc
27+
```jsonc
2828
{
29-
"fortran.includePaths": [
30-
"/usr/local/include",
31-
"/usr/local"
32-
]
29+
"fortran.includePaths": ["/usr/local/include", "/usr/local"]
3330
}
3431
```
3532

3633
By default the `gfortran` executable is assumed to be found in the path. In order to use a different one or if it can't be found in the path you can point the extension to use a custom one with the `fortran.gfortranExecutable` setting.
3734

38-
``` jsonc
35+
```jsonc
3936
{
40-
"fortran.gfortranExecutable": "/usr/local/bin/gfortran-4.7",
37+
"fortran.gfortranExecutable": "/usr/local/bin/gfortran-4.7"
4138
}
4239
```
4340

4441
If you want to pass extra options to the `gfortran` executable or override the default one, you can use the setting `fortran.linterExtraArgs`. By default `-Wall` is the only option.
4542

46-
``` jsonc
43+
```jsonc
4744
{
48-
"fortran.linterExtraArgs": ["-Wall"],
45+
"fortran.linterExtraArgs": ["-Wall"]
4946
}
5047
```
5148

5249
You can configure what kind of symbols will appear in the symbol list by using
5350

54-
``` jsonc
51+
```jsonc
5552
{
56-
"fortran.symbols": [ "function", "subroutine"]
53+
"fortran.symbols": ["function", "subroutine"]
5754
}
5855
```
5956

@@ -69,7 +66,7 @@ and by default only functions and subroutines are shown
6966

7067
You can also configure the case for fortran intrinsics auto-complete by using
7168

72-
``` jsonc
69+
```jsonc
7370
{
7471
"fortran.preferredCase": "lowercase" | "uppercase"
7572
}
@@ -79,7 +76,7 @@ You can also configure the case for fortran intrinsics auto-complete by using
7976

8077
This is a list of some of the snippets included, if you like to include additional snippets please let me know and I will add them.
8178

82-
#### Program skeleton
79+
### Program skeleton
8380

8481
![program snippet](https://media.giphy.com/media/OYdq9BKYMOOdy/giphy.gif)
8582

@@ -110,33 +107,33 @@ More details about how to setup the debugger can be found in Microsoft's website
110107
- C/C++ extension debugger information: <https://code.visualstudio.com/docs/cpp/cpp-debug>
111108
- Build tasks for easy compiling: <https://code.visualstudio.com/docs/editor/tasks>
112109

113-
``` jsonc
110+
```jsonc
114111
{
115-
// Use IntelliSense to learn about possible attributes.
116-
// Hover to view descriptions of existing attributes.
117-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
118-
"version": "0.2.0",
119-
"configurations": [
112+
// Use IntelliSense to learn about possible attributes.
113+
// Hover to view descriptions of existing attributes.
114+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
115+
"version": "0.2.0",
116+
"configurations": [
117+
{
118+
"name": "(gdb) Fortran",
119+
"type": "cppdbg",
120+
"request": "launch",
121+
"program": "${workspaceFolder}/a.out",
122+
"args": [], // Possible input args for a.out
123+
"stopAtEntry": false,
124+
"cwd": "${workspaceFolder}",
125+
"environment": [],
126+
"externalConsole": false,
127+
"MIMode": "gdb",
128+
"setupCommands": [
120129
{
121-
"name": "(gdb) Fortran",
122-
"type": "cppdbg",
123-
"request": "launch",
124-
"program": "${workspaceFolder}/a.out",
125-
"args": [], // Possible input args for a.out
126-
"stopAtEntry": false,
127-
"cwd": "${workspaceFolder}",
128-
"environment": [],
129-
"externalConsole": false,
130-
"MIMode": "gdb",
131-
"setupCommands": [
132-
{
133-
"description": "Enable pretty-printing for gdb",
134-
"text": "-enable-pretty-printing",
135-
"ignoreFailures": true
136-
}
137-
]
130+
"description": "Enable pretty-printing for gdb",
131+
"text": "-enable-pretty-printing",
132+
"ignoreFailures": true
138133
}
139-
]
134+
]
135+
}
136+
]
140137
}
141138
```
142139

@@ -148,7 +145,7 @@ For debugging you need to have one of the following debuggers installed:
148145

149146
- **Linux**: GDB
150147
- **macOS**: GDB or LLDB
151-
- **Windows**: GDB or Visual Studio Windows Debugger
148+
- **Windows**: GDB or Visual Studio Windows Debugger
152149

153150
## Issues
154151

coverconfig.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"enabled": true,
3-
"relativeSourcePath": "../src",
4-
"relativeCoverageDir": "../../coverage",
5-
"ignorePatterns": ["**/node_modules/**"],
6-
"includePid": false,
7-
"reports": ["json", "html", "lcov"],
8-
"verbose": false
9-
}
2+
"enabled": true,
3+
"relativeSourcePath": "../src",
4+
"relativeCoverageDir": "../../coverage",
5+
"ignorePatterns": ["**/node_modules/**"],
6+
"includePid": false,
7+
"reports": ["json", "html", "lcov"],
8+
"verbose": false
9+
}

language-configuration.json

Lines changed: 48 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,51 @@
11
{
2-
"comments": {
3-
"lineComment": "!"
2+
"comments": {
3+
"lineComment": "!"
4+
},
5+
"brackets": [
6+
["[", "]"],
7+
["(", ")"],
8+
["(/", "/)"]
9+
],
10+
"autoClosingPairs": [
11+
{
12+
"open": "[",
13+
"close": "]"
414
},
5-
"brackets": [
6-
[
7-
"[",
8-
"]"
9-
],
10-
[
11-
"(",
12-
")"
13-
],
14-
[
15-
"(/",
16-
"/)"
17-
]
18-
],
19-
"autoClosingPairs": [
20-
{
21-
"open": "[",
22-
"close": "]"
23-
},
24-
{
25-
"open": "(",
26-
"close": ")"
27-
},
28-
{
29-
"open": "(/",
30-
"close": "/"
31-
},
32-
{
33-
"open": "'",
34-
"close": "'",
35-
"notIn": [
36-
"string",
37-
"comment"
38-
]
39-
},
40-
{
41-
"open": "\"",
42-
"close": "\"",
43-
"notIn": [
44-
"string",
45-
"comment"
46-
]
47-
},
48-
],
49-
"surroundingPairs": [
50-
[
51-
"[",
52-
"]"
53-
],
54-
[
55-
"(",
56-
")"
57-
],
58-
[
59-
"'",
60-
"'"
61-
],
62-
[
63-
"\"",
64-
"\""
65-
]
66-
],
67-
"indentationRules": {
68-
"unIndentedLinePattern": "^\\s*!.*",
69-
"increaseIndentPattern": {
70-
"pattern": "then(\\s*|\\s*!.*)$|^\\s*(program|subroutine|function|module|do|block|associate|case|select\\s*case)\\b.*$|\\s*(else|else\\s*if|elsewhere)\\b.*$",
71-
"flags": "i"
72-
},
73-
"decreaseIndentPattern": {
74-
"pattern": "^\\s*end\\s*(select|if|do|function|subroutine|module|program)\\b.*$|^\\s*(else|case)\\b.*$",
75-
"flags": "i"
76-
}
15+
{
16+
"open": "(",
17+
"close": ")"
18+
},
19+
{
20+
"open": "(/",
21+
"close": "/"
22+
},
23+
{
24+
"open": "'",
25+
"close": "'",
26+
"notIn": ["string", "comment"]
27+
},
28+
{
29+
"open": "\"",
30+
"close": "\"",
31+
"notIn": ["string", "comment"]
32+
}
33+
],
34+
"surroundingPairs": [
35+
["[", "]"],
36+
["(", ")"],
37+
["'", "'"],
38+
["\"", "\""]
39+
],
40+
"indentationRules": {
41+
"unIndentedLinePattern": "^\\s*!.*",
42+
"increaseIndentPattern": {
43+
"pattern": "then(\\s*|\\s*!.*)$|^\\s*(program|subroutine|function|module|do|block|associate|case|select\\s*case)\\b.*$|\\s*(else|else\\s*if|elsewhere)\\b.*$",
44+
"flags": "i"
45+
},
46+
"decreaseIndentPattern": {
47+
"pattern": "^\\s*end\\s*(select|if|do|function|subroutine|module|program)\\b.*$|^\\s*(else|case)\\b.*$",
48+
"flags": "i"
7749
}
78-
}
50+
}
51+
}

src/extension.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ export function activate(context: vscode.ExtensionContext) {
3131

3232
if (extensionConfig.get('provideCompletion', true)) {
3333
const completionProvider = new FortranCompletionProvider(loggingService);
34-
vscode.languages.registerCompletionItemProvider(
35-
FORTRAN_DOCUMENT_SELECTOR,
36-
completionProvider
37-
);
34+
vscode.languages.registerCompletionItemProvider(FORTRAN_DOCUMENT_SELECTOR, completionProvider);
3835
} else {
3936
loggingService.logInfo('Completion Provider is not enabled');
4037
}
@@ -49,10 +46,7 @@ export function activate(context: vscode.ExtensionContext) {
4946

5047
if (extensionConfig.get('provideSymbols', true)) {
5148
const symbolProvider = new FortranDocumentSymbolProvider();
52-
vscode.languages.registerDocumentSymbolProvider(
53-
FORTRAN_DOCUMENT_SELECTOR,
54-
symbolProvider
55-
);
49+
vscode.languages.registerDocumentSymbolProvider(FORTRAN_DOCUMENT_SELECTOR, symbolProvider);
5650
loggingService.logInfo('Symbol Provider is enabled');
5751
} else {
5852
loggingService.logInfo('Symbol Provider is not enabled');

0 commit comments

Comments
 (0)