Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ jobs:
- name: Run mypy
run: poetry run task mypy

- name: Run pylint
run: poetry run task pylint

- name: Run ruff
run: poetry run task ruff

Expand Down
268 changes: 1 addition & 267 deletions poetry.lock

Large diffs are not rendered by default.

28 changes: 3 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,15 @@ binarylane-python-client = "^0.13.2a0"
safety = "<3.0.0"
ruff = "^0.9.6"

[tool.poetry.group.pylint.dependencies]
pylint = { version = "^3.3.4", python = ">=3.9" }

[tool.poetry.group.pylint-38.dependencies]
pylint = { version = "^2.15.2", python = "<3.9" }

[tool.taskipy.tasks]
generate = "python scripts/generate.py"
black = "black ."
isort = "isort ."
mypy = "mypy ."
ruff = "ruff check src"
pylint = "pylint src"
safety = "poetry export -f requirements.txt | safety check --bare --stdin"
test = "pytest tests"
check = "task isort && task black && task mypy && task ruff && task pylint && task test && task safety"
check = "task isort && task black && task mypy && task ruff && task test && task safety"

[tool.isort]
py_version = 37
Expand All @@ -69,23 +62,8 @@ exclude = [
]

[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "TC"]

[tool.pylint.format]
max-line-length = 120
ignore-paths = ['src/binarylane/console/commands/*/']

[tool.pylint.messages_control]
disable = [
"import-outside-toplevel", # CLI programs need delayed import
"design", # design checker is too opinionated
"fixme", # FIXME: initial impl in progress

# Checkbox documentation is bad:
"missing-module-docstring",
"missing-class-docstring",
"missing-function-docstring",
]
select = ["E4", "E7", "E9", "F", "TC", "PL"]
ignore = ["PLR"]

[tool.mypy]
disallow_any_generics = true
Expand Down
1 change: 0 additions & 1 deletion src/binarylane/console/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def main() -> int:
App().run(sys.argv[1:])
return 0

# pylint: disable=broad-except
except Exception as exc:
logger.exception(exc)
return -1
Expand Down
1 change: 0 additions & 1 deletion src/binarylane/console/parser/list_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def __init__(
option_name: Optional[str] = None,
description: Optional[str] = None,
) -> None:
# pylint: disable=duplicate-code
super().__init__(
attribute_name,
attribute_type,
Expand Down
2 changes: 1 addition & 1 deletion src/binarylane/console/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

from binarylane.console.parser.object_attribute import Mapping

ArgumentGroup: TypeAlias = argparse._ArgumentGroup # pylint: disable=protected-access
ArgumentGroup: TypeAlias = argparse._ArgumentGroup

logger = logging.getLogger(__name__)

Expand Down
1 change: 0 additions & 1 deletion src/binarylane/console/parser/primitive_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ def lookup(self, value: str) -> object:
# If not, perform a lookup using the provided value
result = self._lookup(value)
if result is None:
# pylint: disable=raise-missing-from
raise argparse.ArgumentError(None, f"{self.attribute_name.upper()}: could not find '{value}'")
return result

Expand Down
3 changes: 2 additions & 1 deletion src/binarylane/console/printers/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def _flatten(values: Sequence[Any], single_object: bool = False) -> List[str]:
max_str = 80 if not single_object else 240
trunc = "..."

for item in values:
for value in values:
item = value
item_type = type(item)
if item_type is list:
if len(item) > max_list:
Expand Down
4 changes: 1 addition & 3 deletions src/binarylane/console/runners/httpx_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def __init__(self) -> None:
_httpx_request: Optional[Callable[..., httpx.Response]]

def __enter__(self: WrapperT) -> WrapperT:
# pylint: disable=used-before-assignment
self._httpx_request = httpx.request
httpx.request = self.request
return self
Expand All @@ -42,11 +41,10 @@ def request(self, *args: Any, **kwargs: Any) -> httpx.Response:
def __exit__(
self, exc_type: Optional[type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> None:
# pylint: disable=used-before-assignment
httpx.request = self._httpx_request # type: ignore


class CurlCommand(HttpxWrapper): # pylint: disable=too-few-public-methods
class CurlCommand(HttpxWrapper):
"""Convert HTTP request to a curl command-line. The HTTP request is not performed."""

shell: str
Expand Down
8 changes: 4 additions & 4 deletions src/binarylane/pycompat/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ def __init__(
option_strings: Sequence[str],
dest: str,
default: Union[object, str, None] = None,
type: Union[Callable[[str], object], argparse.FileType, None] = None, # pylint: disable=redefined-builtin
type: Union[Callable[[str], object], argparse.FileType, None] = None,
choices: Union[Iterable[object], None] = None,
required: bool = False,
help: Union[str, None] = None, # pylint: disable=redefined-builtin
help: Union[str, None] = None,
metavar: Union[str, Tuple[str, ...], None] = None,
) -> None:
_option_strings = []
for option_string in option_strings:
_option_strings.append(option_string)

if option_string.startswith("--"):
option_string = "--no-" + option_string[2:]
_option_strings.append(option_string)
negative_option_string = "--no-" + option_string[2:]
_option_strings.append(negative_option_string)

if help is not None and default is not None and default is not argparse.SUPPRESS:
help += " (default: %(default)s)"
Expand Down
Loading