for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
"""
SDoc
Copyright 2016 Set Based IT Consultancy
Licence MIT
# ----------------------------------------------------------------------------------------------------------------------
import antlr4
antlr4
This can be caused by one of the following:
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
# .scrutinizer.yml before_commands: - sudo pip install abc # Python2 - sudo pip3 install abc # Python3
This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.
__init__.py
import sdoc
from sdoc.antlr.sdoc2Lexer import sdoc2Lexer
from sdoc.antlr.sdoc2Parser import sdoc2Parser
from sdoc.sdoc2.SDoc2visitor import SDoc2Visitor
class SDoc2Interpreter:
Class for processing SDoc1 documents.
# ------------------------------------------------------------------------------------------------------------------
def __init__(self):
Object constructor.
pass
def process(self, infile):
If a method does not access any attributes of the class, it could also be implemented as a function or static method. This can help improve readability. For example
class Foo: def some_method(self, x, y): return x + y;
could be written as
class Foo: @classmethod def some_method(cls, x, y): return x + y;
Processes a SDoc1 document.
:param str infile: The input filename with the SDoc2 document.
in_stream = antlr4.FileStream(infile, 'utf-8')
lexer = sdoc2Lexer(in_stream)
tokens = antlr4.CommonTokenStream(lexer)
parser = sdoc2Parser(tokens)
tree = parser.sdoc()
visitor = SDoc2Visitor()
visitor.visit(tree)
SDoc2Visitor
visit
This check looks for calls to members that are non-existent. These calls will fail.
The member could have been renamed or removed.
sdoc.sdoc2.node_store.prepare_content_tree()
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.py
files in your module folders. Make sure that you place one file in each sub-folder.