# Path: src/tidypy/tools/base.py
# class PythonTool(Tool):
#     """
#     A convenience abstract class that automatically sets the ``filters`` in the
#     tool configuration to target Python source files.
#     """
# 
#     # pylint: disable=abstract-method
# 
#     @classmethod
#     def get_default_config(cls):
#         config = Tool.get_default_config()
#         config['filters'] = [
#             r'\.py$',
#         ]
#         return config
# 
# class Issue:
#     """
#     A class that encapsulates an issue found during the analysis of a project.
#     """
# 
#     #: A string containing name of the tool that found the issue.
#     tool = None
# 
#     #: A string containing a code that identifies the type of issue found.
#     code = None
# 
#     #: A string containing a description of the issue.
#     message = None
# 
#     #: A string containing the full path to the file where the issue was found.
#     filename = None
# 
#     #: The line number within the file where the issue was found (if known).
#     #: The first line in a file is notated as 1 (not zero).
#     line = None
# 
#     #: The character number within the line of the file where the issue was
#     #: found (if known). The first column in a line is notated as 1 (not zero).
#     character = None
# 
#     #: A character indicating the comparable pylint category this issue would
#     #: fall into: E=error, W=warning, R=refactor, C=convention
#     pylint_type = 'E'
# 
#     def __init__(
#             self,
#             code=None,
#             message=None,
#             filename=None,
#             line=None,
#             character=None):
#         self.code = code
#         self.message = message
#         self.filename = filename
#         self.line = line if line is not None else 1
#         self.character = character or None
# 
#     def __repr__(self):
#         return '%s(%s)' % (
#             self.__class__.__name__,
#             ', '.join([
#                 repr(self.code),
#                 repr(self.message),
#                 repr(self.filename),
#                 repr(self.line),
#                 repr(self.character),
#             ]),
#         )
# 
# class AccessIssue(TidyPyIssue):
#     """
#     An issue indicating that a file/directory cannot be accessed (typically
#     due to permissions).
#     """
# 
#     def __init__(self, exc, filename):
#         super().__init__(
#             'access',
#             'Cannot access file (%s)' % (exc,),
#             filename,
#         )
# 
# class ParseIssue(TidyPyIssue):
#     """
#     An issue indicating that a file could not be parsed as expected (e.g., a
#     Python source file with invalid syntax).
#     """
# 
#     def __init__(self, exc, filename, line=None, character=None):
#         if isinstance(exc, SyntaxError):
#             line = exc.lineno
#             character = exc.offset
# 
#         super().__init__(
#             'parse',
#             'Unable to parse file (%s)' % (exc,),
#             filename,
#             line,
#             character,
#         )


from pep8ext_naming import NamingChecker
from pycodestyle import StyleGuide, BaseReport, register_check
from .base import PythonTool, Issue, AccessIssue, ParseIssue
    tool = 'pycodestyle'
    pylint_type = 'C'

    def __init__(self, code, message, filename, line, character):
        if code in ('E101',):
            line = None
        super().__init__(
            code,
            message,
            filename,
            line,
            character,
        )


class TidyPyReport(BaseReport):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._tidypy_issues = []

    def error(self, line_number, offset, text, check):
        code = super().error(
            line_number,
            offset,
            text,
            check,
        )

        if code == 'E901':
            message = text[5:].split(':', 1)[1].lstrip()

# Path: src/tidypy/tools/base.py
# class PythonTool(Tool):
#     """
#     A convenience abstract class that automatically sets the ``filters`` in the
#     tool configuration to target Python source files.
#     """
# 
#     # pylint: disable=abstract-method
# 
#     @classmethod
#     def get_default_config(cls):
#         config = Tool.get_default_config()
#         config['filters'] = [
#             r'\.py$',
#         ]
#         return config
# 
# class Issue:
#     """
#     A class that encapsulates an issue found during the analysis of a project.
#     """
# 
#     #: A string containing name of the tool that found the issue.
#     tool = None
# 
#     #: A string containing a code that identifies the type of issue found.
#     code = None
# 
#     #: A string containing a description of the issue.
#     message = None
# 
#     #: A string containing the full path to the file where the issue was found.
#     filename = None
# 
#     #: The line number within the file where the issue was found (if known).
#     #: The first line in a file is notated as 1 (not zero).
#     line = None
# 
#     #: The character number within the line of the file where the issue was
#     #: found (if known). The first column in a line is notated as 1 (not zero).
#     character = None
# 
#     #: A character indicating the comparable pylint category this issue would
#     #: fall into: E=error, W=warning, R=refactor, C=convention
#     pylint_type = 'E'
# 
#     def __init__(
#             self,
#             code=None,
#             message=None,
#             filename=None,
#             line=None,
#             character=None):
#         self.code = code
#         self.message = message
#         self.filename = filename
#         self.line = line if line is not None else 1
#         self.character = character or None
# 
#     def __repr__(self):
#         return '%s(%s)' % (
#             self.__class__.__name__,
#             ', '.join([
#                 repr(self.code),
#                 repr(self.message),
#                 repr(self.filename),
#                 repr(self.line),
#                 repr(self.character),
#             ]),
#         )
# 
# class AccessIssue(TidyPyIssue):
#     """
#     An issue indicating that a file/directory cannot be accessed (typically
#     due to permissions).
#     """
# 
#     def __init__(self, exc, filename):
#         super().__init__(
#             'access',
#             'Cannot access file (%s)' % (exc,),
#             filename,
#         )
# 
# class ParseIssue(TidyPyIssue):
#     """
#     An issue indicating that a file could not be parsed as expected (e.g., a
#     Python source file with invalid syntax).
#     """
# 
#     def __init__(self, exc, filename, line=None, character=None):
#         if isinstance(exc, SyntaxError):
#             line = exc.lineno
#             character = exc.offset
# 
#         super().__init__(
#             'parse',
#             'Unable to parse file (%s)' % (exc,),
#             filename,
#             line,
#             character,
#         )


# Path: src/tidypy/tools/pycodestyle.py
from pep8ext_naming import NamingChecker
from pycodestyle import StyleGuide, BaseReport, register_check
from .base import PythonTool, Issue, AccessIssue, ParseIssue

    tool = 'pycodestyle'
    pylint_type = 'C'

    def __init__(self, code, message, filename, line, character):
        if code in ('E101',):
            line = None
        super().__init__(
            code,
            message,
            filename,
            line,
            character,
        )


class TidyPyReport(BaseReport):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self._tidypy_issues = []

    def error(self, line_number, offset, text, check):
        code = super().error(
            line_number,
            offset,
            text,
            check,
        )

        if code == 'E901':
            message = text[5:].split(':', 1)[1].lstrip()

            self._tidypy_issues.append(ParseIssue(