Commit fcb7224c authored by Thanassis Tsiodras's avatar Thanassis Tsiodras
Browse files

Sync up with latest versions of analysis tools.

parent d5960792
Pipeline #6748 failed with stage
in 21 seconds
......@@ -212,8 +212,7 @@ def OneTimeOnly(
outputDir: str,
maybeFVname: str,
unused_useOSS: bool) -> None:
for typename in asnParser.g_names:
node = asnParser.g_names[typename]
for node in asnParser.g_names.values():
VerifySingleFieldEnums(node)
global g_outputDir
......
......@@ -227,8 +227,6 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
param: Param,
leafTypeDict: AST_Leaftypes,
names: AST_Lookup) -> None:
global fpgaSuffix
if encoding.lower() not in self.supportedEncodings:
panic(str(self.__class__) + ": in (%s), encoding can be one of %s (not '%s')" % ( # pragma: no cover
subProgram._id + "." + subProgramImplementation, self.supportedEncodings, encoding)) # pragma: no cover
......@@ -403,7 +401,6 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
param: Param,
leafTypeDict: AST_Leaftypes,
names: AST_Lookup) -> None:
global fpgaSuffix
tmpSpName = "Convert_From_%s_To_%s_In_%s_%s" % \
(encoding.lower(),
......@@ -613,10 +610,6 @@ class SynchronousToolGlueGeneratorGeneric(Generic[TSource, TDestin]):
self.Common(nodeTypename, node, subProgram, subProgramImplementation, param, leafTypeDict, names)
def OnShutdown(self, modelingLanguage: str, asnFile: str, sp: ApLevelContainer, subProgramImplementation: str, maybeFVname: str) -> None:
global genFpgaDevDrv
global fpgaSuffix
global dispatcherSuffix
if modelingLanguage == "QGenAda":
self.ADA_HeaderFile.write(" procedure Execute_%s (" % self.CleanNameAsADAWants(sp._id + "_" + subProgramImplementation))
self.ADA_SourceFile.write(" procedure Execute_%s (" % self.CleanNameAsADAWants(sp._id + "_" + subProgramImplementation))
......
......@@ -199,7 +199,7 @@ of each SUBPROGRAM param.'''
klass = commonPy
for step in python2className.split('.')[1:]:
klass = getattr(klass, step)
o.__class__ = klass
o.__class__ = klass # pylint: disable=invalid-class-object
except Exception:
pass
......@@ -365,12 +365,11 @@ def ProcessAsync( # pylint: disable=dangerous-default-value
leafTypeDict = commonPy.asnParser.g_leafTypeDict
inform("This param uses definitions from %s", asnFile)
for nodeTypename in names:
for nodeTypename, node in names.items():
# Check if this type must be skipped
if nodeTypename in badTypes:
continue
node = names[nodeTypename]
inform("ASN.1 node is %s", nodeTypename)
# First, make sure we know what leaf type this node is
......@@ -500,7 +499,7 @@ def main() -> None:
if "-pdb" in sys.argv:
sys.argv.remove("-pdb") # pragma: no cover
import pdb # pragma: no cover pylint: disable=wrong-import-position,wrong-import-order
pdb.set_trace() # pragma: no cover
pdb.set_trace() # pragma: no cover pylint: disable=forgotten-debug-statement
use_ASN1SCC_allboards_support = "-allboards" in sys.argv
if use_ASN1SCC_allboards_support:
......
......@@ -192,7 +192,7 @@ def main() -> None:
continue # bug in coverage.py... # pragma: no cover
# Work on each ASN.1 file's types
for asnFile in uniqueASNfiles:
for asnFile in uniqueASNfiles: # pylint: disable=consider-using-dict-items
if 'OnStartup' in dir(backend):
backend.OnStartup(modelingLanguage, asnFile, configMT.outputDir, badTypes)
......
......@@ -348,7 +348,7 @@ def IsInvalidType(name: str) -> bool:
return \
(name.lower() in g_invalidKeywords) or \
(name.lower() in lotokens) or \
any([name.lower().endswith(x) for x in ["-buffer", "-buffer-max"]])
any(name.lower().endswith(x) for x in ["-buffer", "-buffer-max"])
def CheckForInvalidKeywords(node_or_str: Union[str, AsnNode]) -> None:
......@@ -553,7 +553,7 @@ def GetAttrCertainly(node: Element, attrName: str) -> Any:
return node._attrs[attrName]
def GetChild(node: Element, childName: str) -> Element:
def GetChild(node: Element, childName: str) -> Element: # pylint: disable=inconsistent-return-statements
for x in node._children:
if x._name == childName:
return x
......@@ -930,7 +930,7 @@ def PrintType(f: IO[Any], xmlType: Element, indent: str, nameCleaner: Callable[[
f.write(' (%s .. %s)' % (mmin, mmax))
elif realType._name == "BitStringType":
utility.panic("BIT STRINGs are not supported, use SEQUENCE OF BOOLEAN") # pragma: no cover
elif realType._name == "OctetStringType" or realType._name == "IA5StringType" or realType._name == "NumericStringType":
elif realType._name in ["OctetStringType", "IA5StringType", "NumericStringType"]:
f.write('OCTET STRING')
mmin = GetAttrCertainly(realType, "Min")
mmax = GetAttrCertainly(realType, "Max")
......@@ -949,7 +949,7 @@ def PrintType(f: IO[Any], xmlType: Element, indent: str, nameCleaner: Callable[[
for otherOptions in options[1:]:
f.write(',\n' + indent + ' ' + nameCleaner(GetAttrCertainly(otherOptions, "StringValue")) + "(" + GetAttrCertainly(otherOptions, "IntValue") + ")")
f.write('\n' + indent + '}')
elif realType._name == "SequenceType" or realType._name == "SetType":
elif realType._name in ["SequenceType", "SetType"]:
if realType._name == "SequenceType":
f.write('SEQUENCE {\n')
else:
......
......@@ -64,8 +64,7 @@ def DiscoverBadTypes() -> SetOfBadTypenames:
# Hack for IA5Strings (IA5s are used in TASTE's runtime configuration spec)
while True:
foundOne = False
for nodeTypename in names:
nodeAST = names[nodeTypename]
for nodeTypename, nodeAST in names.items():
if nodeTypename not in badTypes and CheckNodeForIA5(nodeAST):
badTypes.add(nodeTypename)
foundOne = True
......
......@@ -60,7 +60,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=coerce-method,nonzero-method,buffer-builtin,unichr-builtin,reload-builtin,using-cmp-argument,reduce-builtin,filter-builtin-not-iterating,zip-builtin-not-iterating,raising-string,long-builtin,backtick,long-suffix,delslice-method,suppressed-message,cmp-method,old-octal-literal,basestring-builtin,metaclass-assignment,print-statement,execfile-builtin,round-builtin,oct-method,standarderror-builtin,hex-method,import-star-module-level,indexing-exception,map-builtin-not-iterating,old-ne-operator,setslice-method,input-builtin,apply-builtin,range-builtin-not-iterating,xrange-builtin,parameter-unpacking,no-absolute-import,old-raise-syntax,dict-iter-method,unicode-builtin,unpacking-in-except,old-division,file-builtin,next-method-called,useless-suppression,raw_input-builtin,intern-builtin,getslice-method,dict-view-method,cmp-builtin,coerce-builtin,line-too-long,missing-docstring,protected-access,global-statement,too-many-arguments,too-many-branches,too-many-locals,bare-except,invalid-name,too-many-statements,broad-except,too-many-instance-attributes,too-many-public-methods,too-few-public-methods,similarities,no-else-return,fixme,relative-beyond-top-level,import-outside-toplevel
disable=coerce-method,nonzero-method,buffer-builtin,unichr-builtin,reload-builtin,using-cmp-argument,reduce-builtin,filter-builtin-not-iterating,zip-builtin-not-iterating,raising-string,long-builtin,backtick,long-suffix,delslice-method,suppressed-message,cmp-method,old-octal-literal,basestring-builtin,metaclass-assignment,print-statement,execfile-builtin,round-builtin,oct-method,standarderror-builtin,hex-method,import-star-module-level,indexing-exception,map-builtin-not-iterating,old-ne-operator,setslice-method,input-builtin,apply-builtin,range-builtin-not-iterating,xrange-builtin,parameter-unpacking,no-absolute-import,old-raise-syntax,dict-iter-method,unicode-builtin,unpacking-in-except,old-division,file-builtin,next-method-called,useless-suppression,raw_input-builtin,intern-builtin,getslice-method,dict-view-method,cmp-builtin,coerce-builtin,line-too-long,missing-docstring,protected-access,global-statement,too-many-arguments,too-many-branches,too-many-locals,bare-except,invalid-name,too-many-statements,broad-except,too-many-instance-attributes,too-many-public-methods,too-few-public-methods,similarities,no-else-return,fixme,relative-beyond-top-level,import-outside-toplevel,consider-using-f-string,consider-using-with,unspecified-encoding,forgotten-debug-statement
never-returning-functions=dmt.commonPy.utility.panic,sys.exit
......
coverage>=3.7.1
coverage==3.7.1
flake8==3.7.9
mypy==0.790
pyflakes>=1.2.3
pylint>=1.7.0
pylint>=2.11.1
pytest>=2.6.3
lxml>=3.6.0
astroid>=1.4.6
pycodestyle>=2.0.0
astroid>=2.8.3
typing-extensions
mypy-extensions>=0.4.3
pycodestyle==2.5.0
pyflakes==2.1.1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment