예제 #1
0
def PIE800(lineno: int, col_offset: int) -> Error:
    return Error(
        lineno=lineno,
        col_offset=col_offset,
        message=
        "PIE800: no-unnecessary-spread: Consider inlining the dict values.",
    )
예제 #2
0
def PIE805(lineno: int, col_offset: int) -> Error:
    return Error(
        lineno=lineno,
        col_offset=col_offset,
        message=
        "PIE805: prefer-literal: Prefer the byte string literal rather than calling encode.",
    )
def err(lineno: int, col_offset: int) -> Error:
    return Error(
        lineno=lineno,
        col_offset=col_offset,
        message="PIE807: prefer-list-builtin: use the builtin list type instead of a lambda.",
    )
예제 #4
0
def PIE806(lineno: int, col_offset: int) -> Error:
    return Error(
        lineno=lineno,
        col_offset=col_offset,
        message="PIE806: no-assert-except: Instead of asserting and catching, use an if statment.",
    )
예제 #5
0
파일: utils.py 프로젝트: sbdchd/flake8-pie
def to_errors(flake8_err: Iterable[Flake8Error]) -> list[Error]:
    return [
        Error(lineno=err.lineno,
              col_offset=err.col_offset,
              message=err.message) for err in flake8_err
    ]
예제 #6
0
def err(lineno: int, col_offset: int) -> Error:
    return Error(
        lineno=lineno,
        col_offset=col_offset,
        message="PIE808: prefer-simple-range: range starts at 0 by default.",
    )
예제 #7
0
def err(lineno: int, col_offset: int) -> Error:
    return Error(
        lineno=lineno,
        col_offset=col_offset,
        message="PIE809: django-prefer-bulk: bulk create multiple objects.",
    )