Skip to content

Commit

Permalink
linting BF
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienRietteMTO committed Nov 6, 2024
1 parent 04bb701 commit 1cb21b2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
11 changes: 5 additions & 6 deletions bin/testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ if [ ${force} -eq 1 -o $(get_statuses "${SHA}" | grep -w "${context}" | wc -l) -
log 1 "Check pylint"
set +e
score=$(pylint -d R0912,C0209,R0915,R1702,C0302,R0913,R0914,W1202,R0904,R0902 \
--persistent=n -f parseable bin/pyfortool* src/pyfortool/ | \
--persistent=n -f parseable src/pyfortool/ bin/pyfortool* | \
grep 'Your code has been rated at' | cut -d\ -f 7 | cut -d/ -f 1)
set -e
if [ $(python3 -c "print(0 if ${score} >= 9.8 else 1)") -ne 0 ]; then
Expand All @@ -284,19 +284,18 @@ if [ ${force} -eq 1 -o $(get_statuses "${SHA}" | grep -w "${context}" | wc -l) -
#Check flake8
log 1 "Check flake8"
set +e
score=$(flake8 bin/*.py src/pyfortool/ | wc -l)
score=$(flake8 bin/pyfortool* src/pyfortool/ | wc -l)
retval=$?
set -e
if [ $retval -ne 0 ]; then
ret=1
log 0 " flake8 score: ERROR"
else
if [ ${score} -ne 0 ]; then
ret=1
log 0 " flake8 score: problem"
else
log 0 " flake8 score: OK"
log 0 " flake8 score: ERROR"
fi
else
log 0 " flake8 score: OK"
fi

#Test examples
Expand Down
3 changes: 2 additions & 1 deletion src/pyfortool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
# Import the public part of the package
from . import util # pylint: disable=wrong-import-position # noqa: F401 E402
from . import expressions # pylint: disable=wrong-import-position # noqa: F401 E402
from .pyfortool import PYFT, conservativePYFT # pylint: disable=wrong-import-position # noqa: F401 E402
# pylint: disable-next=wrong-import-position
from .pyfortool import PYFT, conservativePYFT # noqa: F401 E402
from . import tree # pylint: disable=wrong-import-position # noqa: F401 E402
12 changes: 6 additions & 6 deletions src/pyfortool/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -1447,9 +1447,9 @@ def insertInArgList(varName, varNameToUse, pos, callFuncStmt):
xml = self.mainScope
pft = None
else:
pft = pyfortool.pyfortoolconservativePYFT(filename, parser, parserOptions,
wrapH, tree=self.tree,
clsPYFT=self._mainScope.__class__)
pft = pyfortool.pyfortoolconservativePYFT(
filename, parser, parserOptions, wrapH, tree=self.tree,
clsPYFT=self._mainScope.__class__)
xml = pft
scopeInterface = xml.getScopeNode(scopePathInterface)
varInterface = scopeInterface.varList.findVar(varName, exactScope=True)
Expand Down Expand Up @@ -1479,9 +1479,9 @@ def insertInArgList(varName, varNameToUse, pos, callFuncStmt):
xml = self.mainScope
pft = None
else:
pft = pyfortool.pyfortool.conservativePYFT(filename, parser, parserOptions,
wrapH, tree=self.tree,
clsPYFT=self._mainScope.__class__)
pft = pyfortool.pyfortool.conservativePYFT(
filename, parser, parserOptions, wrapH, tree=self.tree,
clsPYFT=self._mainScope.__class__)
xml = pft
scopeUp = xml.getScopeNode(scopePathUp)
# Add the argument and propagate upward
Expand Down

0 comments on commit 1cb21b2

Please sign in to comment.