The following issues were found
coq/databases/insertions/database.py
19 issues
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.
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.
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.
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.
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.
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.
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.
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.
Line: 21
Column: 1
@dataclass(frozen=True)
class Statistics:
source: str
interrupted: int
inserted: int
avg_duration: float
Reported by Pylint.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
Line: 13
Column: 5
class VimCompKind(Enum):
variable = "v"
function = "f"
member = "m"
typedef = "t"
define = "d"
Reported by Pylint.
Line: 14
Column: 5
class VimCompKind(Enum):
variable = "v"
function = "f"
member = "m"
typedef = "t"
define = "d"
Reported by Pylint.
Line: 15
Column: 5
class VimCompKind(Enum):
variable = "v"
function = "f"
member = "m"
typedef = "t"
define = "d"
@dataclass(frozen=True)
Reported by Pylint.
Line: 16
Column: 5
variable = "v"
function = "f"
member = "m"
typedef = "t"
define = "d"
@dataclass(frozen=True)
class UserData:
Reported by Pylint.
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
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.
Line: 8
Column: 1
from std2.itertools import deiter
from ...shared.types import Context
class ParseError(Exception):
pass
Reported by Pylint.
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.
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.
Line: 11
Column: 1
from ...shared.types import Context
class ParseError(Exception):
pass
@dataclass(frozen=True)
class Index:
Reported by Pylint.
Line: 16
Column: 1
@dataclass(frozen=True)
class Index:
i: int
row: int
col: int
Reported by Pylint.
Line: 26
Column: 1
@dataclass(frozen=True)
class ParseInfo:
visual: str
@dataclass(frozen=False)
class ParserState:
Reported by Pylint.
Line: 31
Column: 1
@dataclass(frozen=False)
class ParserState:
depth: int
@dataclass(frozen=True)
class ParserCtx(Iterator):
Reported by Pylint.
Line: 36
Column: 1
@dataclass(frozen=True)
class ParserCtx(Iterator):
ctx: Context
text: str
info: ParseInfo
dit: deiter[EChar]
state: ParserState
Reported by Pylint.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.