from linter_adapters.common import BaseCategory, Severity
from linter_adapters.parser import BaseViolationParser


class Flake8BugbearCategory(BaseCategory):
    ProbablyErrors  = 000
    Optimizations   = 900

@BaseViolationParser.register_decorator('B')
class Flake8BugbearViolationParser(BaseViolationParser[Flake8BugbearCategory]):
    ViolationCategory = Flake8BugbearCategory
    provider_name = 'flake8-bugbear'
    severity_mapping = \
    {
        Flake8BugbearCategory.ProbablyErrors:   Severity.Error,
        Flake8BugbearCategory.Optimizations:    Severity.Refactor,
    }
    default_severity = Severity.Error


__all__ = \
[
    'Flake8BugbearCategory',
    'Flake8BugbearViolationParser',
]
