# 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,
#         )
# 
# class UnknownIssue(TidyPyIssue):
#     """
#     A completely unanticipated exception/problem was encountered during the
#     execution of a tool.
#     """
# 
#     def __init__(self, exc, filename):
#         super().__init__(
#             'unexpected',
#             'Unexpected error (%s)' % (exc,),
#             filename,
#         )


import logging
from pydocstyle import check, Error
from pydocstyle.parser import ParseError, AllError
from pydocstyle.violations import ErrorRegistry
from .base import PythonTool, Issue, AccessIssue, ParseIssue, UnknownIssue
        logging.disable(logging.CRITICAL)

        for filepath in finder.files(self.config['filters']):
            issues += [
                self.make_issue(error, filepath)
                for error in check(
                    (filepath,),
                    ignore=self.config['disabled'],
                )
            ]

        logging.disable(logging.NOTSET)

        return issues

    def make_issue(self, error, filename):
        if isinstance(error, Error):
            return PyDocStyleIssue(
                error.code,
                error.short_desc,
                filename,
                error.line,
            )

        if isinstance(error, EnvironmentError):
            return AccessIssue(error, filename)

        if isinstance(error, (AllError, ParseError, SyntaxError)):
            return ParseIssue(error, filename)


# 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,
#         )
# 
# class UnknownIssue(TidyPyIssue):
#     """
#     A completely unanticipated exception/problem was encountered during the
#     execution of a tool.
#     """
# 
#     def __init__(self, exc, filename):
#         super().__init__(
#             'unexpected',
#             'Unexpected error (%s)' % (exc,),
#             filename,
#         )


# Path: src/tidypy/tools/pydocstyle.py
import logging
from pydocstyle import check, Error
from pydocstyle.parser import ParseError, AllError
from pydocstyle.violations import ErrorRegistry
from .base import PythonTool, Issue, AccessIssue, ParseIssue, UnknownIssue

        logging.disable(logging.CRITICAL)

        for filepath in finder.files(self.config['filters']):
            issues += [
                self.make_issue(error, filepath)
                for error in check(
                    (filepath,),
                    ignore=self.config['disabled'],
                )
            ]

        logging.disable(logging.NOTSET)

        return issues

    def make_issue(self, error, filename):
        if isinstance(error, Error):
            return PyDocStyleIssue(
                error.code,
                error.short_desc,
                filename,
                error.line,
            )

        if isinstance(error, EnvironmentError):
            return AccessIssue(error, filename)

        if isinstance(error, (AllError, ParseError, SyntaxError)):
            return ParseIssue(error, filename)


        return UnknownIssue(error, filename)