The following issues were found

coq/databases/insertions/database.py
19 issues
Unable to import 'std2.asyncio'
Error

Line: 10 Column: 1

              from threading import Lock
from typing import Iterator, Mapping, Optional

from std2.asyncio import run_in_executor
from std2.sqlite3 import with_transaction

from ...consts import INSERT_DB
from ...shared.executor import SingleThreadExecutor
from ...shared.sql import init_db

            

Reported by Pylint.

Unable to import 'std2.sqlite3'
Error

Line: 11 Column: 1

              from typing import Iterator, Mapping, Optional

from std2.asyncio import run_in_executor
from std2.sqlite3 import with_transaction

from ...consts import INSERT_DB
from ...shared.executor import SingleThreadExecutor
from ...shared.sql import init_db
from ...shared.timeit import timeit

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              from std2.asyncio import run_in_executor
from std2.sqlite3 import with_transaction

from ...consts import INSERT_DB
from ...shared.executor import SingleThreadExecutor
from ...shared.sql import init_db
from ...shared.timeit import timeit
from .sql import sql


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              from std2.sqlite3 import with_transaction

from ...consts import INSERT_DB
from ...shared.executor import SingleThreadExecutor
from ...shared.sql import init_db
from ...shared.timeit import timeit
from .sql import sql



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 15 Column: 1

              
from ...consts import INSERT_DB
from ...shared.executor import SingleThreadExecutor
from ...shared.sql import init_db
from ...shared.timeit import timeit
from .sql import sql


@dataclass(frozen=True)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 16 Column: 1

              from ...consts import INSERT_DB
from ...shared.executor import SingleThreadExecutor
from ...shared.sql import init_db
from ...shared.timeit import timeit
from .sql import sql


@dataclass(frozen=True)
class Statistics:

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 17 Column: 1

              from ...shared.executor import SingleThreadExecutor
from ...shared.sql import init_db
from ...shared.timeit import timeit
from .sql import sql


@dataclass(frozen=True)
class Statistics:
    source: str

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from asyncio.exceptions import CancelledError
from concurrent.futures import Executor
from contextlib import closing
from dataclasses import dataclass
from json import loads
from sqlite3 import Connection, OperationalError
from threading import Lock
from typing import Iterator, Mapping, Optional


            

Reported by Pylint.

Too many instance attributes (11/7)
Error

Line: 21 Column: 1

              

@dataclass(frozen=True)
class Statistics:
    source: str
    interrupted: int
    inserted: int

    avg_duration: float

            

Reported by Pylint.

Missing class docstring
Error

Line: 21 Column: 1

              

@dataclass(frozen=True)
class Statistics:
    source: str
    interrupted: int
    inserted: int

    avg_duration: float

            

Reported by Pylint.

tests/shared/trans.py
18 issues
Attempted relative import beyond top-level package
Error

Line: 3 Column: 1

              from unittest import TestCase

from ...coq.shared.trans import trans
from ...coq.shared.types import Edit


class Trans(TestCase):
    def test_1(self) -> None:
        lhs, rhs = "", ""

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 4 Column: 1

              from unittest import TestCase

from ...coq.shared.trans import trans
from ...coq.shared.types import Edit


class Trans(TestCase):
    def test_1(self) -> None:
        lhs, rhs = "", ""

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 13 Column: 9

                      edit = ""
        expected = "", ""
        actual = trans(lhs, rhs, edit=Edit(new_text=edit))
        self.assertEquals((actual.old_prefix, actual.old_suffix), expected)

    def test_2(self) -> None:
        lhs, rhs = "a", "b"
        edit = "ab"
        expected = "a", "b"

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 20 Column: 9

                      edit = "ab"
        expected = "a", "b"
        actual = trans(lhs, rhs, edit=Edit(new_text=edit))
        self.assertEquals((actual.old_prefix, actual.old_suffix), expected)

    def test_3(self) -> None:
        lhs, rhs = "ab", "c"
        edit = "bc"
        expected = "b", "c"

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 27 Column: 9

                      edit = "bc"
        expected = "b", "c"
        actual = trans(lhs, rhs, edit=Edit(new_text=edit))
        self.assertEquals((actual.old_prefix, actual.old_suffix), expected)

    def test_4(self) -> None:
        lhs, rhs = "ab", "c"
        edit = "bb"
        expected = "b", ""

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 34 Column: 9

                      edit = "bb"
        expected = "b", ""
        actual = trans(lhs, rhs, edit=Edit(new_text=edit))
        self.assertEquals((actual.old_prefix, actual.old_suffix), expected)

    def test_5(self) -> None:
        lhs, rhs = "abd", "efc"
        edit = "bd"
        expected = "bd", ""

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 41 Column: 9

                      edit = "bd"
        expected = "bd", ""
        actual = trans(lhs, rhs, edit=Edit(new_text=edit))
        self.assertEquals((actual.old_prefix, actual.old_suffix), expected)

    def test_6(self) -> None:
        lhs, rhs = "ab", "c"
        edit = "bbc"
        expected = "b", "c"

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 48 Column: 9

                      edit = "bbc"
        expected = "b", "c"
        actual = trans(lhs, rhs, edit=Edit(new_text=edit))
        self.assertEquals((actual.old_prefix, actual.old_suffix), expected)

    def test_7(self) -> None:
        lhs, rhs = "abe", "cd"
        edit = "becf"
        expected = "be", ""

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 55 Column: 9

                      edit = "becf"
        expected = "be", ""
        actual = trans(lhs, rhs, edit=Edit(new_text=edit))
        self.assertEquals((actual.old_prefix, actual.old_suffix), expected)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from unittest import TestCase

from ...coq.shared.trans import trans
from ...coq.shared.types import Edit


class Trans(TestCase):
    def test_1(self) -> None:
        lhs, rhs = "", ""

            

Reported by Pylint.

ci/main.py
18 issues
Using subprocess.run without explicitly set `check` is not recommended.
Error

Line: 48 Column: 12

                  if refs:
        check_call(("git", "push", "--delete", "origin", *refs), cwd=cwd)

    proc = run(("git", "diff", "--exit-code"), cwd=cwd)
    if proc.returncode:
        time = datetime.now(tz=timezone.utc).strftime("%Y-%m-%d_%H-%M-%S")
        brname = f"{prefix}--{time}"
        check_call(("git", "checkout", "-b", brname), cwd=cwd)
        check_call(("git", "add", "."), cwd=cwd)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from datetime import datetime, timezone
from os import environ, sep
from pathlib import Path
from shutil import rmtree
from subprocess import check_call, check_output, run
from typing import Iterator

_TOP_LV = Path(__file__).resolve().parent.parent


            

Reported by Pylint.

Consider possible security implications associated with check_call module.
Security blacklist

Line: 5
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess

              from os import environ, sep
from pathlib import Path
from shutil import rmtree
from subprocess import check_call, check_output, run
from typing import Iterator

_TOP_LV = Path(__file__).resolve().parent.parent



            

Reported by Bandit.

subprocess call - check for execution of untrusted input.
Security injection

Line: 14
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b603_subprocess_without_shell_equals_true.html

              def _git_identity() -> None:
    email = "ci@ci.ci"
    username = "ci-bot"
    check_call(("git", "config", "--global", "user.email", email))
    check_call(("git", "config", "--global", "user.name", username))


def _git_clone(path: Path, repo_name: str) -> None:
    if path.is_dir():

            

Reported by Bandit.

subprocess call - check for execution of untrusted input.
Security injection

Line: 15
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b603_subprocess_without_shell_equals_true.html

                  email = "ci@ci.ci"
    username = "ci-bot"
    check_call(("git", "config", "--global", "user.email", email))
    check_call(("git", "config", "--global", "user.name", username))


def _git_clone(path: Path, repo_name: str) -> None:
    if path.is_dir():
        rmtree(path)

            

Reported by Bandit.

subprocess call - check for execution of untrusted input.
Security injection

Line: 24
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b603_subprocess_without_shell_equals_true.html

              
    token = environ["CI_TOKEN"]
    uri = f"https://ms-jpq:{token}@github.com/ms-jpq/{repo_name}.git"
    check_call(("git", "clone", uri, str(path)))


def _build(cwd: Path) -> None:
    check_call(("python3", "-m", "coq.ci"), cwd=cwd)


            

Reported by Bandit.

subprocess call - check for execution of untrusted input.
Security injection

Line: 28
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b603_subprocess_without_shell_equals_true.html

              

def _build(cwd: Path) -> None:
    check_call(("python3", "-m", "coq.ci"), cwd=cwd)


def _git_alert(cwd: Path) -> None:
    prefix = "ci"
    check_call(("git", "fetch"), cwd=cwd)

            

Reported by Bandit.

subprocess call - check for execution of untrusted input.
Security injection

Line: 33
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b603_subprocess_without_shell_equals_true.html

              
def _git_alert(cwd: Path) -> None:
    prefix = "ci"
    check_call(("git", "fetch"), cwd=cwd)
    remote_brs = check_output(("git", "branch", "--remotes"), text=True, cwd=cwd)

    def cont() -> Iterator[str]:
        for br in remote_brs.splitlines():
            b = br.strip()

            

Reported by Bandit.

subprocess call - check for execution of untrusted input.
Security injection

Line: 34
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b603_subprocess_without_shell_equals_true.html

              def _git_alert(cwd: Path) -> None:
    prefix = "ci"
    check_call(("git", "fetch"), cwd=cwd)
    remote_brs = check_output(("git", "branch", "--remotes"), text=True, cwd=cwd)

    def cont() -> Iterator[str]:
        for br in remote_brs.splitlines():
            b = br.strip()
            if b and "->" not in b:

            

Reported by Bandit.

Variable name "br" doesn't conform to snake_case naming style
Error

Line: 37 Column: 13

                  remote_brs = check_output(("git", "branch", "--remotes"), text=True, cwd=cwd)

    def cont() -> Iterator[str]:
        for br in remote_brs.splitlines():
            b = br.strip()
            if b and "->" not in b:
                _, _, name = b.partition(sep)
                if name.startswith(prefix):
                    yield name

            

Reported by Pylint.

coq/databases/snippets/database.py
17 issues
Unable to import 'std2.asyncio'
Error

Line: 9 Column: 1

              from typing import AbstractSet, Iterable, Iterator, Mapping, TypedDict, cast
from uuid import uuid4

from std2.asyncio import run_in_executor
from std2.sqlite3 import with_transaction

from ...consts import SNIPPET_DB
from ...shared.executor import SingleThreadExecutor
from ...shared.settings import Options

            

Reported by Pylint.

Unable to import 'std2.sqlite3'
Error

Line: 10 Column: 1

              from uuid import uuid4

from std2.asyncio import run_in_executor
from std2.sqlite3 import with_transaction

from ...consts import SNIPPET_DB
from ...shared.executor import SingleThreadExecutor
from ...shared.settings import Options
from ...shared.sql import BIGGEST_INT, init_db

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              from std2.asyncio import run_in_executor
from std2.sqlite3 import with_transaction

from ...consts import SNIPPET_DB
from ...shared.executor import SingleThreadExecutor
from ...shared.settings import Options
from ...shared.sql import BIGGEST_INT, init_db
from ...shared.timeit import timeit
from ...snippets.types import ParsedSnippet

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              from std2.sqlite3 import with_transaction

from ...consts import SNIPPET_DB
from ...shared.executor import SingleThreadExecutor
from ...shared.settings import Options
from ...shared.sql import BIGGEST_INT, init_db
from ...shared.timeit import timeit
from ...snippets.types import ParsedSnippet
from .sql import sql

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              
from ...consts import SNIPPET_DB
from ...shared.executor import SingleThreadExecutor
from ...shared.settings import Options
from ...shared.sql import BIGGEST_INT, init_db
from ...shared.timeit import timeit
from ...snippets.types import ParsedSnippet
from .sql import sql


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 15 Column: 1

              from ...consts import SNIPPET_DB
from ...shared.executor import SingleThreadExecutor
from ...shared.settings import Options
from ...shared.sql import BIGGEST_INT, init_db
from ...shared.timeit import timeit
from ...snippets.types import ParsedSnippet
from .sql import sql



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 16 Column: 1

              from ...shared.executor import SingleThreadExecutor
from ...shared.settings import Options
from ...shared.sql import BIGGEST_INT, init_db
from ...shared.timeit import timeit
from ...snippets.types import ParsedSnippet
from .sql import sql


class _Snip(TypedDict):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 17 Column: 1

              from ...shared.settings import Options
from ...shared.sql import BIGGEST_INT, init_db
from ...shared.timeit import timeit
from ...snippets.types import ParsedSnippet
from .sql import sql


class _Snip(TypedDict):
    grammar: str

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 18 Column: 1

              from ...shared.sql import BIGGEST_INT, init_db
from ...shared.timeit import timeit
from ...snippets.types import ParsedSnippet
from .sql import sql


class _Snip(TypedDict):
    grammar: str
    prefix: str

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from asyncio import CancelledError
from concurrent.futures import Executor
from contextlib import closing
from sqlite3 import Connection, Cursor, OperationalError
from threading import Lock
from typing import AbstractSet, Iterable, Iterator, Mapping, TypedDict, cast
from uuid import uuid4

from std2.asyncio import run_in_executor

            

Reported by Pylint.

coq/server/registrants/noop.py
17 issues
Unable to import 'pynvim'
Error

Line: 9 Column: 1

              from sys import stderr, stdout
from typing import Sequence, Tuple

from pynvim import Nvim
from std2.argparse import ArgparseError, ArgParser
from std2.pickle import new_decoder
from yaml import safe_load

from ...consts import HELO_ARTIFACTS

            

Reported by Pylint.

Unable to import 'std2.argparse'
Error

Line: 10 Column: 1

              from typing import Sequence, Tuple

from pynvim import Nvim
from std2.argparse import ArgparseError, ArgParser
from std2.pickle import new_decoder
from yaml import safe_load

from ...consts import HELO_ARTIFACTS
from ...registry import rpc

            

Reported by Pylint.

Unable to import 'std2.pickle'
Error

Line: 11 Column: 1

              
from pynvim import Nvim
from std2.argparse import ArgparseError, ArgParser
from std2.pickle import new_decoder
from yaml import safe_load

from ...consts import HELO_ARTIFACTS
from ...registry import rpc
from ..rt_types import Stack

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              from std2.pickle import new_decoder
from yaml import safe_load

from ...consts import HELO_ARTIFACTS
from ...registry import rpc
from ..rt_types import Stack


@dataclass(frozen=True)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 15 Column: 1

              from yaml import safe_load

from ...consts import HELO_ARTIFACTS
from ...registry import rpc
from ..rt_types import Stack


@dataclass(frozen=True)
class _Helo:

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 16 Column: 1

              
from ...consts import HELO_ARTIFACTS
from ...registry import rpc
from ..rt_types import Stack


@dataclass(frozen=True)
class _Helo:
    chars: Tuple[int, int]

            

Reported by Pylint.

Unused argument 'stack'
Error

Line: 37 Column: 21

              

@rpc(blocking=True)
def now(nvim: Nvim, stack: Stack, args: Sequence[str]) -> None:
    try:
        ns = _parse_args(args)
    except ArgparseError as e:
        print(e, file=stderr, flush=True)
    else:

            

Reported by Pylint.

Unused argument 'nvim'
Error

Line: 37 Column: 9

              

@rpc(blocking=True)
def now(nvim: Nvim, stack: Stack, args: Sequence[str]) -> None:
    try:
        ns = _parse_args(args)
    except ArgparseError as e:
        print(e, file=stderr, flush=True)
    else:

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from argparse import Namespace
from dataclasses import dataclass
from itertools import chain
from os import linesep
from random import choice, sample
from sys import stderr, stdout
from typing import Sequence, Tuple

from pynvim import Nvim

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 37 Column: 1

              

@rpc(blocking=True)
def now(nvim: Nvim, stack: Stack, args: Sequence[str]) -> None:
    try:
        ns = _parse_args(args)
    except ArgparseError as e:
        print(e, file=stderr, flush=True)
    else:

            

Reported by Pylint.

coq/_registry.py
16 issues
Attempted relative import beyond top-level package
Error

Line: 1 Column: 1

              from .lsp.requests import completion, preview, request
from .server.registrants import attachment, autocmds, help, marks, noop, omnifunc
from .server.registrants import preview as rp
from .server.registrants import stats

____ = None

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 2 Column: 1

              from .lsp.requests import completion, preview, request
from .server.registrants import attachment, autocmds, help, marks, noop, omnifunc
from .server.registrants import preview as rp
from .server.registrants import stats

____ = None

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 3 Column: 1

              from .lsp.requests import completion, preview, request
from .server.registrants import attachment, autocmds, help, marks, noop, omnifunc
from .server.registrants import preview as rp
from .server.registrants import stats

____ = None

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 4 Column: 1

              from .lsp.requests import completion, preview, request
from .server.registrants import attachment, autocmds, help, marks, noop, omnifunc
from .server.registrants import preview as rp
from .server.registrants import stats

____ = None

            

Reported by Pylint.

Unused request imported from lsp.requests
Error

Line: 1 Column: 1

              from .lsp.requests import completion, preview, request
from .server.registrants import attachment, autocmds, help, marks, noop, omnifunc
from .server.registrants import preview as rp
from .server.registrants import stats

____ = None

            

Reported by Pylint.

Unused completion imported from lsp.requests
Error

Line: 1 Column: 1

              from .lsp.requests import completion, preview, request
from .server.registrants import attachment, autocmds, help, marks, noop, omnifunc
from .server.registrants import preview as rp
from .server.registrants import stats

____ = None

            

Reported by Pylint.

Unused preview imported from lsp.requests
Error

Line: 1 Column: 1

              from .lsp.requests import completion, preview, request
from .server.registrants import attachment, autocmds, help, marks, noop, omnifunc
from .server.registrants import preview as rp
from .server.registrants import stats

____ = None

            

Reported by Pylint.

Unused noop imported from server.registrants
Error

Line: 2 Column: 1

              from .lsp.requests import completion, preview, request
from .server.registrants import attachment, autocmds, help, marks, noop, omnifunc
from .server.registrants import preview as rp
from .server.registrants import stats

____ = None

            

Reported by Pylint.

Redefining built-in 'help'
Error

Line: 2 Column: 1

              from .lsp.requests import completion, preview, request
from .server.registrants import attachment, autocmds, help, marks, noop, omnifunc
from .server.registrants import preview as rp
from .server.registrants import stats

____ = None

            

Reported by Pylint.

Unused autocmds imported from server.registrants
Error

Line: 2 Column: 1

              from .lsp.requests import completion, preview, request
from .server.registrants import attachment, autocmds, help, marks, noop, omnifunc
from .server.registrants import preview as rp
from .server.registrants import stats

____ = None

            

Reported by Pylint.

coq/server/reviewer.py
16 issues
Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              from typing import Mapping
from uuid import UUID, uuid4

from ..databases.insertions.database import IDB
from ..shared.context import EMPTY_CONTEXT
from ..shared.fuzzy import MatchMetrics, metrics
from ..shared.parse import coalesce, display_width, is_word, lower
from ..shared.runtime import Metric, PReviewer
from ..shared.settings import BaseClient, Options, Weights

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              from uuid import UUID, uuid4

from ..databases.insertions.database import IDB
from ..shared.context import EMPTY_CONTEXT
from ..shared.fuzzy import MatchMetrics, metrics
from ..shared.parse import coalesce, display_width, is_word, lower
from ..shared.runtime import Metric, PReviewer
from ..shared.settings import BaseClient, Options, Weights
from ..shared.types import Completion, Context

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              
from ..databases.insertions.database import IDB
from ..shared.context import EMPTY_CONTEXT
from ..shared.fuzzy import MatchMetrics, metrics
from ..shared.parse import coalesce, display_width, is_word, lower
from ..shared.runtime import Metric, PReviewer
from ..shared.settings import BaseClient, Options, Weights
from ..shared.types import Completion, Context


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              from ..databases.insertions.database import IDB
from ..shared.context import EMPTY_CONTEXT
from ..shared.fuzzy import MatchMetrics, metrics
from ..shared.parse import coalesce, display_width, is_word, lower
from ..shared.runtime import Metric, PReviewer
from ..shared.settings import BaseClient, Options, Weights
from ..shared.types import Completion, Context



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              from ..shared.context import EMPTY_CONTEXT
from ..shared.fuzzy import MatchMetrics, metrics
from ..shared.parse import coalesce, display_width, is_word, lower
from ..shared.runtime import Metric, PReviewer
from ..shared.settings import BaseClient, Options, Weights
from ..shared.types import Completion, Context


@dataclass(frozen=True)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              from ..shared.fuzzy import MatchMetrics, metrics
from ..shared.parse import coalesce, display_width, is_word, lower
from ..shared.runtime import Metric, PReviewer
from ..shared.settings import BaseClient, Options, Weights
from ..shared.types import Completion, Context


@dataclass(frozen=True)
class _ReviewCtx:

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              from ..shared.parse import coalesce, display_width, is_word, lower
from ..shared.runtime import Metric, PReviewer
from ..shared.settings import BaseClient, Options, Weights
from ..shared.types import Completion, Context


@dataclass(frozen=True)
class _ReviewCtx:
    batch: UUID

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from collections import Counter
from dataclasses import dataclass
from itertools import chain
from math import e
from typing import Mapping
from uuid import UUID, uuid4

from ..databases.insertions.database import IDB
from ..shared.context import EMPTY_CONTEXT

            

Reported by Pylint.

Argument name "x" doesn't conform to snake_case naming style
Error

Line: 41 Column: 1

                  return metrics(cword, match, look_ahead=options.look_ahead)


def sigmoid(x: float) -> float:
    """
    x -> y ∈ (0.5, 1.5)
    """

    return 1 / (1 + e ** -x) + 0.5

            

Reported by Pylint.

Missing class docstring
Error

Line: 74 Column: 1

                  return metric


class Reviewer(PReviewer):
    def __init__(self, options: Options, db: IDB) -> None:
        self._options, self._db = options, db
        self._ctx = _ReviewCtx(
            batch=uuid4(),
            context=EMPTY_CONTEXT,

            

Reported by Pylint.

coq/server/nvim/completions.py
15 issues
Unable to import 'pynvim'
Error

Line: 6 Column: 1

              from typing import Any, Iterable, Optional, Sequence, Tuple
from uuid import UUID

from pynvim import Nvim
from std2.pickle import new_encoder

from ...shared.types import Doc, Extern, PrimaryEdit, RangeEdit



            

Reported by Pylint.

Unable to import 'std2.pickle'
Error

Line: 7 Column: 1

              from uuid import UUID

from pynvim import Nvim
from std2.pickle import new_encoder

from ...shared.types import Doc, Extern, PrimaryEdit, RangeEdit


class VimCompKind(Enum):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              from pynvim import Nvim
from std2.pickle import new_encoder

from ...shared.types import Doc, Extern, PrimaryEdit, RangeEdit


class VimCompKind(Enum):
    variable = "v"
    function = "f"

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from dataclasses import dataclass
from enum import Enum
from typing import Any, Iterable, Optional, Sequence, Tuple
from uuid import UUID

from pynvim import Nvim
from std2.pickle import new_encoder

from ...shared.types import Doc, Extern, PrimaryEdit, RangeEdit

            

Reported by Pylint.

Missing class docstring
Error

Line: 12 Column: 1

              from ...shared.types import Doc, Extern, PrimaryEdit, RangeEdit


class VimCompKind(Enum):
    variable = "v"
    function = "f"
    member = "m"
    typedef = "t"
    define = "d"

            

Reported by Pylint.

Constant name "variable" doesn't conform to UPPER_CASE naming style
Error

Line: 13 Column: 5

              

class VimCompKind(Enum):
    variable = "v"
    function = "f"
    member = "m"
    typedef = "t"
    define = "d"


            

Reported by Pylint.

Constant name "function" doesn't conform to UPPER_CASE naming style
Error

Line: 14 Column: 5

              
class VimCompKind(Enum):
    variable = "v"
    function = "f"
    member = "m"
    typedef = "t"
    define = "d"



            

Reported by Pylint.

Constant name "member" doesn't conform to UPPER_CASE naming style
Error

Line: 15 Column: 5

              class VimCompKind(Enum):
    variable = "v"
    function = "f"
    member = "m"
    typedef = "t"
    define = "d"


@dataclass(frozen=True)

            

Reported by Pylint.

Constant name "typedef" doesn't conform to UPPER_CASE naming style
Error

Line: 16 Column: 5

                  variable = "v"
    function = "f"
    member = "m"
    typedef = "t"
    define = "d"


@dataclass(frozen=True)
class UserData:

            

Reported by Pylint.

Constant name "define" doesn't conform to UPPER_CASE naming style
Error

Line: 17 Column: 5

                  function = "f"
    member = "m"
    typedef = "t"
    define = "d"


@dataclass(frozen=True)
class UserData:
    uid: UUID

            

Reported by Pylint.

coq/snippets/parsers/types.py
15 issues
Unable to import 'std2.itertools'
Error

Line: 6 Column: 1

              from dataclasses import dataclass
from typing import Iterator, Mapping, Sequence, Tuple, Union

from std2.itertools import deiter

from ...shared.types import Context


class ParseError(Exception):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              
from std2.itertools import deiter

from ...shared.types import Context


class ParseError(Exception):
    pass


            

Reported by Pylint.

Unused Mapping imported from typing
Error

Line: 4 Column: 1

              from __future__ import annotations

from dataclasses import dataclass
from typing import Iterator, Mapping, Sequence, Tuple, Union

from std2.itertools import deiter

from ...shared.types import Context


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import annotations

from dataclasses import dataclass
from typing import Iterator, Mapping, Sequence, Tuple, Union

from std2.itertools import deiter

from ...shared.types import Context


            

Reported by Pylint.

Missing class docstring
Error

Line: 11 Column: 1

              from ...shared.types import Context


class ParseError(Exception):
    pass


@dataclass(frozen=True)
class Index:

            

Reported by Pylint.

Missing class docstring
Error

Line: 16 Column: 1

              

@dataclass(frozen=True)
class Index:
    i: int
    row: int
    col: int



            

Reported by Pylint.

Missing class docstring
Error

Line: 26 Column: 1

              

@dataclass(frozen=True)
class ParseInfo:
    visual: str


@dataclass(frozen=False)
class ParserState:

            

Reported by Pylint.

Missing class docstring
Error

Line: 31 Column: 1

              

@dataclass(frozen=False)
class ParserState:
    depth: int


@dataclass(frozen=True)
class ParserCtx(Iterator):

            

Reported by Pylint.

Missing class docstring
Error

Line: 36 Column: 1

              

@dataclass(frozen=True)
class ParserCtx(Iterator):
    ctx: Context
    text: str
    info: ParseInfo
    dit: deiter[EChar]
    state: ParserState

            

Reported by Pylint.

Missing class docstring
Error

Line: 51 Column: 1

              

@dataclass(frozen=True)
class Unparsed:
    text: str


@dataclass(frozen=True)
class Begin:

            

Reported by Pylint.

coq/server/mark.py
15 issues
Unable to import 'pynvim.api.common'
Error

Line: 4 Column: 1

              from typing import Sequence
from uuid import uuid4

from pynvim.api.common import NvimError
from pynvim.api.nvim import Buffer, Nvim
from pynvim_pp.lib import write
from pynvim_pp.logging import log

from ..lang import LANG

            

Reported by Pylint.

Unable to import 'pynvim.api.nvim'
Error

Line: 5 Column: 1

              from uuid import uuid4

from pynvim.api.common import NvimError
from pynvim.api.nvim import Buffer, Nvim
from pynvim_pp.lib import write
from pynvim_pp.logging import log

from ..lang import LANG
from ..shared.settings import Settings

            

Reported by Pylint.

Unable to import 'pynvim_pp.lib'
Error

Line: 6 Column: 1

              
from pynvim.api.common import NvimError
from pynvim.api.nvim import Buffer, Nvim
from pynvim_pp.lib import write
from pynvim_pp.logging import log

from ..lang import LANG
from ..shared.settings import Settings
from ..shared.types import Mark

            

Reported by Pylint.

Unable to import 'pynvim_pp.logging'
Error

Line: 7 Column: 1

              from pynvim.api.common import NvimError
from pynvim.api.nvim import Buffer, Nvim
from pynvim_pp.lib import write
from pynvim_pp.logging import log

from ..lang import LANG
from ..shared.settings import Settings
from ..shared.types import Mark


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              from pynvim_pp.lib import write
from pynvim_pp.logging import log

from ..lang import LANG
from ..shared.settings import Settings
from ..shared.types import Mark

NS = uuid4().hex


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              from pynvim_pp.logging import log

from ..lang import LANG
from ..shared.settings import Settings
from ..shared.types import Mark

NS = uuid4().hex



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              
from ..lang import LANG
from ..shared.settings import Settings
from ..shared.types import Mark

NS = uuid4().hex


def mark(nvim: Nvim, settings: Settings, buf: Buffer, marks: Sequence[Mark]) -> None:

            

Reported by Pylint.

Redefining name 'mark' from outer scope (line 16)
Error

Line: 21 Column: 9

                  ns = nvim.api.create_namespace(NS)
    nvim.api.buf_clear_namespace(buf, ns, 0, -1)

    for mark in mks:
        (r1, c1), (r2, c2) = mark.begin, mark.end
        opts = {
            "id": mark.idx + 1,
            "end_line": r2,
            "end_col": c2,

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from typing import Sequence
from uuid import uuid4

from pynvim.api.common import NvimError
from pynvim.api.nvim import Buffer, Nvim
from pynvim_pp.lib import write
from pynvim_pp.logging import log

from ..lang import LANG

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 16 Column: 1

              NS = uuid4().hex


def mark(nvim: Nvim, settings: Settings, buf: Buffer, marks: Sequence[Mark]) -> None:
    mks = tuple(mark for mark in marks if mark.idx or mark.text)
    ns = nvim.api.create_namespace(NS)
    nvim.api.buf_clear_namespace(buf, ns, 0, -1)

    for mark in mks:

            

Reported by Pylint.