from linter_adapters.common import Severity
from linter_adapters.parser import SingleCategoryViolationParser


@SingleCategoryViolationParser.register_decorator('T')
class Flake8DebuggerViolationParser(SingleCategoryViolationParser):
    provider_name = 'flake8-debugger'
    category_name = 'DebuggerUsage'
    category_number = 100
    default_severity = Severity.Error


@SingleCategoryViolationParser.register_decorator('I')
class Flake8ImportSortViolationParser(SingleCategoryViolationParser):
    provider_name = 'flake8-isort'
    category_name = 'ImportsPositioning'
    category_number = 000
    default_severity = Severity.Convention


@SingleCategoryViolationParser.register_decorator('N')
class Flake8BrokenLineViolationParser(SingleCategoryViolationParser):
    provider_name = 'flake8-broken-line'
    category_name = 'Linebreaks'
    category_number = 400
    default_severity = Severity.Convention


@SingleCategoryViolationParser.register_decorator('DTZ')
class Flake8DateTimeZoneViolationParser(SingleCategoryViolationParser):
    provider_name = 'flake8-datetimez'
    category_name = 'Timezone'
    category_number = 000
    default_severity = Severity.Error


@SingleCategoryViolationParser.register_decorator('Q')
class Flake8QuotesViolationParser(SingleCategoryViolationParser):
    provider_name = 'flake8-quotes'
    category_name = 'Quotes'
    category_number = 000
    default_severity = Severity.Convention


__all__ = \
[
    'Flake8BrokenLineViolationParser',
    'Flake8DateTimeZoneViolationParser',
    'Flake8DebuggerViolationParser',
    'Flake8ImportSortViolationParser',
    'Flake8QuotesViolationParser',
]
