Skip to content

Commit b6468bb

Browse files
committed
satisfy pylint
1 parent 98ba829 commit b6468bb

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

.github/workflows/pretty.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v3
1717

18-
- name: Count
18+
- name: Format diff
1919
run: ./mfc.sh format diff

src/common/include/inline_conversions.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
c = (1d0/(rho*(adv(1)/blkmod1 + adv(2)/blkmod2)))
2121
elseif (model_eqns == 3) then
2222
c = 0d0
23-
!$acc loop seq
23+
!$acc loop seq
2424
do q = 1, num_fluids
2525
c = c + adv(q)*(1d0/gammas(q) + 1d0)* &
2626
(pres + pi_infs(q)/(gammas(q) + 1d0))

src/common/include/macros.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#:def DEALLOCATE(*args)
2323
@:LOG({'@:DEALLOCATE(${re.sub(' +', ' ', ', '.join(args))}$)'})
2424
deallocate (${', '.join(args)}$)
25-
!$acc exit data delete(${', '.join(args)}$)
25+
!$acc exit data delete(${', '.join(args)}$)
2626
#:enddef DEALLOCATE
2727

2828
#define t_vec3 real(kind(0d0)), dimension(1:3)

toolchain/bootstrap/format.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ if [ "$1" == "diff" ]; then
1919
fi
2020

2121
# Indent acc directives
22-
for filename in src/*/*.f*; do
22+
srcfiles=( src/*/*.f* )
23+
includefiles=( src/*/include/*.f* )
24+
files=( "${srcfiles[@]}" "${includefiles[@]}" )
25+
for filename in ${files[@]}; do
2326
python3 toolchain/indenter.py "$filename"
2427
done
2528

toolchain/indenter.py

100755100644
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
def main():
66
num_args = len(sys.argv)
77
if num_args != 2:
8-
AssertionError('Invalid number of arguments, found ', num_args)
8+
raise Exception('Invalid number of arguments, found ', num_args)
99

1010
infile = str(sys.argv[1])
1111
outfile = infile+".new"
1212
adjust_indentation(infile, outfile)
1313
os.replace(outfile,infile)
1414

15+
# pylint: disable=too-many-branches
1516
def adjust_indentation(input_file, output_file):
1617
startingchar='!$acc'
1718
startingloop1='!$acc parallel loop'
@@ -22,8 +23,10 @@ def adjust_indentation(input_file, output_file):
2223
lines = file_in.readlines()
2324

2425
# this makes sure !$acc lines that have line continuations get indented at proper level
25-
for kk in range(10):
26+
# pylint: disable=too-many-nested-blocks
27+
for _ in range(10):
2628
# loop through file
29+
# pylint: disable=consider-using-enumerate
2730
for i in range(len(lines)):
2831
if lines[i].lstrip().startswith(startingchar) and i + 1 < len(lines):
2932
j = i + 1
@@ -50,7 +53,7 @@ def adjust_indentation(input_file, output_file):
5053
while k >= 0:
5154
# if line above is not empty
5255
if lines[k].strip() != '':
53-
# if line 2 above ends with line continuation, indent at that level
56+
# if line 2 above ends with line continuation, indent at that level
5457
if lines[k-1].strip().endswith('&'):
5558
indent = len(lines[k-1]) - len(lines[k-1].lstrip())
5659
# else indent at level of line above

0 commit comments

Comments
 (0)