import token as _token

from .base import (
    BaseGreedyLogicalLineChecker as _Base,
)
from . import __version__


class StrFormatDetector(_Base):
    name = 'use-fstring-format'
    version = __version__

    def __getitem__(self, i: int) -> bool:
        token = self.tokens[i]
        if token.exact_type != _token.DOT:
            return False

        try:
            next_token = self.tokens[i + 1]
        except IndexError:  # pragma: no cover (syntax error)
            return False
        if next_token.exact_type != _token.NAME:
            return False  # pragma: no cover (syntax error)
        if next_token.string != 'format':
            return False

        return True

    def __call__(self, i: int) -> str:
        return "FS002 '.format' used"

    GREEDY_OPTION_NAME = 'format-greedy'

2b71e4444852f192ebe5348a780348bebe8f5740
<mask token>


class StrFormatDetector(_Base):
    <mask token>
    <mask token>

    def __getitem__(self, i: int) ->bool:
        token = self.tokens[i]
        if token.exact_type != _token.DOT:
            return False
        try:
            next_token = self.tokens[i + 1]
        except IndexError:
            return False
        if next_token.exact_type != _token.NAME:
            return False
        if next_token.string != 'format':
            return False
        return True
    <mask token>
    <mask token>

<mask token>


class StrFormatDetector(_Base):
    <mask token>
    <mask token>

    def __getitem__(self, i: int) ->bool:
        token = self.tokens[i]
        if token.exact_type != _token.DOT:
            return False
        try:
            next_token = self.tokens[i + 1]
        except IndexError:
            return False
        if next_token.exact_type != _token.NAME:
            return False
        if next_token.string != 'format':
            return False
        return True

    def __call__(self, i: int) ->str:
        return "FS002 '.format' used"
    <mask token>

<mask token>


class StrFormatDetector(_Base):
    name = 'use-fstring-format'
    version = __version__

    def __getitem__(self, i: int) ->bool:
        token = self.tokens[i]
        if token.exact_type != _token.DOT:
            return False
        try:
            next_token = self.tokens[i + 1]
        except IndexError:
            return False
        if next_token.exact_type != _token.NAME:
            return False
        if next_token.string != 'format':
            return False
        return True

    def __call__(self, i: int) ->str:
        return "FS002 '.format' used"
    GREEDY_OPTION_NAME = 'format-greedy'

import token as _token
from .base import BaseGreedyLogicalLineChecker as _Base
from . import __version__


class StrFormatDetector(_Base):
    name = 'use-fstring-format'
    version = __version__

    def __getitem__(self, i: int) ->bool:
        token = self.tokens[i]
        if token.exact_type != _token.DOT:
            return False
        try:
            next_token = self.tokens[i + 1]
        except IndexError:
            return False
        if next_token.exact_type != _token.NAME:
            return False
        if next_token.string != 'format':
            return False
        return True

    def __call__(self, i: int) ->str:
        return "FS002 '.format' used"
    GREEDY_OPTION_NAME = 'format-greedy'

import token as _token

from .base import (
    BaseGreedyLogicalLineChecker as _Base,
)
from . import __version__


class StrFormatDetector(_Base):
    name = 'use-fstring-format'
    version = __version__

    def __getitem__(self, i: int) -> bool:
        token = self.tokens[i]
        if token.exact_type != _token.DOT:
            return False

        try:
            next_token = self.tokens[i + 1]
        except IndexError:  # pragma: no cover (syntax error)
            return False
        if next_token.exact_type != _token.NAME:
            return False  # pragma: no cover (syntax error)
        if next_token.string != 'format':
            return False

        return True

    def __call__(self, i: int) -> str:
        return "FS002 '.format' used"

    GREEDY_OPTION_NAME = 'format-greedy'
