forked from ExtremeFLOW/neko
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflinter_rc.yml
278 lines (234 loc) · 6.1 KB
/
flinter_rc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# Flinter configuation file.
# These are all the regexp rules
# Set active to false is you want to skip rule
# All are regexp rules, meaning you can add new rules simply by editong this file
# test your rule on https://regex101.com/ if needed
regexp-rules:
missing-spaces-on-do:
message: Missing spaces
regexp: do (\w+)=(\S+),(\S+)
replacement: do \1 = \2, \3
active: true
missing-spaces-around-operator:
message: Missing spaces around operator
regexp: (\w|\))({operators})(\w|\()
replacement: \1 \2 \3
active: true
missing-spaces-before-operator:
message: Missing space before operator
regexp: (\w|\))({operators})
replacement: \1 \2
active: true
missing-spaces-after-operator:
message: Missing space after operator
regexp: ({operators})(\w|\()
replacement: \1 \2
active: true
missing-spaces-around-separator:
message: Missing spaces around separator
regexp: (\S)::(\S)
replacement: '\1 :: \2'
active: true
missing-spaces-before-separator:
message: Missing space before separator
regexp: '(\S)::'
replacement: '\1 ::'
active: true
missing-spaces-after-separator:
message: Missing space after separator
regexp: ::(\S)
replacement: ':: \1'
active: true
missing-spaces-after-ponctuation:
message: Missing space after ponctuation
regexp: ({ponctuations})(\w)
replacement: \1 \2
active: true
types-should-be-lowercased:
message: Types should be lowercased
regexp: \b({types_upper})\b
replacement: null
active: true
missing-space-before-parenthesis:
message: Missing space before parenthesis
regexp: ({structs})\(
replacement: \1 (
active: true
prepend-with-!$:
message: Should prepend with "!$"
regexp: ^(\s*)use omp_lib
replacement: '\1!$ use omp_lib'
active: true
# line-too-long:
# message: Line length > {linelen} characters
# regexp: ^.{linelen_re}.+$
# replacement: null
# active: true
tabulation-insteadof-twospaces:
message: Should use 2 spaces instead of tabulation
regexp: \t
replacement: ' '
active: true
use-new-syntax-type:
message: Use new syntax TYPE(kind)
regexp: ({types})\*(\w+)
replacement: \1(\2)
active: true
one-space-before-comment:
message: At least one space before comment
regexp: (\w)\!
replacement: \1 !
active: true
one-space-after-comment:
message: Exactly one space after comment
regexp: \!(\w)
replacement: '! \1'
active: true
useless-eol-dotcomma:
message: Useless ";" at end of line
regexp: ;\s*$
replacement: \n
active: true
nospace-endif:
message: Missing space after `end'
regexp: \#endif
replacement: null
active: false
nospace-end:
message: Missing space after `end'
regexp: end(if|do|subroutine|function)
replacement: end \1
active: true
missing-spaces-around-=:
message: Missing spaces around "="
regexp: (?<!(\(kind|.\(len))=(\w|\(|\.|\+|-|\'|")
replacement: ' = \2'
active: true
trailing-whitespaces:
message: Trailing whitespaces
regexp: ( \t)+$
replacement: ''
active: true
reommended-use-of-sp-dp:
message: You should use "sp" or "dp" instead
regexp: \(kind\s*=\s*\d\s*\)
replacement: null
active: true
reommended-use-of-brackets:
message: You should use "[]" instead
regexp: \(\\([^\)]*)\\\)
replacement: '[\1]'
active: true
reommended-use-mpi_f08:
message: Should use `use mpi_f08` instead (or `use mpi` if not available)
regexp: include ["\']mpif.h[\'"]
replacement: null
active: true
not-recommended-bare-end:
message: Bare end statement not recommended
regexp: ^end$
replacement: null
active: true
not-recommended-bare-stop:
message: Bare stop statement not recommended
regexp: ^stop$
replacement: null
active: true
not-recommended-use-exit:
message: exit is an extension and should be avoided
regexp: ^exit$
replacement: null
active: true
not-recommended-use-goto:
message: goto is hard to maintain, prone to spaghetti code.
regexp: ^goto.*$
replacement: null
active: true
not-recommended-use-double-precision:
message: double precision is discouraged; use real instead.
regexp: ^double precision.*$
replacement: null
active: true
not-recommended-use-pause:
message: pause is discouraged.
regexp: ^pause.*$
replacement: null
active: true
not-recommended-use-include:
message: include is discouraged, prefer use.
regexp: ^include.*$
replacement: null
active: true
# AD : I did not understood what was tried there
problem-kind:
message: null
regexp: (\(kind|\(len)=
replacement: null
active: false
problem-write:
message: null
regexp: write\(.*\)
replacement: null
active: false
problem-open:
message: null
regexp: open *\([^\)]+\)
replacement: null
active: false
# These are rules that span over multiple lines, not accessible by regexp
# You you want to edit these rules or add your own, two options:
# - ask us.
# - fork the code.
structure-rules:
file-line-lenght: 80
file-line-number: 2000
max-statements-in-context: 300 # Subroutine of function
max-declared-locals: 35
min-varlen: 1
max-varlen: 30
max-arguments: 10
min-arglen: 1
max-arglen: 70
max-nesting-levels: 8
# These are the fortran syntax we use to parse the source
# A priori there is no need to edit, but Fortran is so vast in time...
fortran-syntax:
types:
- real
- character
- logical
- integer
- complex
- double precision
operators:
- '\.eq\.'
- '=='
- '\.neq\.'
- '/='
- '\.gt\.'
- '>'
- '\.lt\.'
- '<'
- '\.geq\.'
- '>='
- '\.leq\.'
- '<='
- '\.le\.'
- '\.ge\.'
- '\.and\.'
- '\.or\.'
structs:
- 'if'
- 'select'
- 'case'
- 'while'
ponctuations:
- ','
- '\)'
- ';'
blocks:
- "program"
- "subroutine"
- "module"
- "function"
- "blockdata"