From c43d978bbc8f09f773731e4979642fad9e359cae Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 1 Nov 2023 14:49:14 -0400 Subject: [PATCH] chore: switch to ruff-format Signed-off-by: Henry Schreiner --- .pre-commit-config.yaml | 6 +----- plumbum/cli/image.py | 1 + plumbum/cli/switches.py | 3 ++- plumbum/typed_env.py | 4 +--- pyproject.toml | 1 + 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3defab809..4052b10ee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,16 +19,12 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace -- repo: https://github.com/psf/black-pre-commit-mirror - rev: "23.10.1" - hooks: - - id: black - - repo: https://github.com/astral-sh/ruff-pre-commit rev: "v0.1.3" hooks: - id: ruff args: ["--fix", "--show-fixes"] + - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy rev: "v1.6.1" diff --git a/plumbum/cli/image.py b/plumbum/cli/image.py index da022b3ad..89cc12e89 100644 --- a/plumbum/cli/image.py +++ b/plumbum/cli/image.py @@ -82,6 +82,7 @@ def show_pil_double(self, im): class ShowImageApp(cli.Application): "Display an image on the terminal" + double = cli.Flag( ["-d", "--double"], help="Double resolution (looks good only with some fonts)" ) diff --git a/plumbum/cli/switches.py b/plumbum/cli/switches.py index 437520bc8..d8c91d83d 100644 --- a/plumbum/cli/switches.py +++ b/plumbum/cli/switches.py @@ -230,7 +230,8 @@ def __init__( argname=VALUE, **kwargs, ): - self.__doc__ = "Sets an attribute" # to prevent the help message from showing SwitchAttr's docstring + # Setting to prevent the help message from showing SwitchAttr's docstring + self.__doc__ = "Sets an attribute" if default and argtype is not None: defaultmsg = _("; the default is {0}").format(default) if "help" in kwargs: diff --git a/plumbum/typed_env.py b/plumbum/typed_env.py index c48e48a4a..9bc85d862 100644 --- a/plumbum/typed_env.py +++ b/plumbum/typed_env.py @@ -93,9 +93,7 @@ class CSV(_BaseVar): a list of objects of type ``type`` (``str`` by default). """ - def __init__( - self, name, default=NO_DEFAULT, type=str, separator="," - ): # pylint:disable=redefined-builtin + def __init__(self, name, default=NO_DEFAULT, type=str, separator=","): # pylint:disable=redefined-builtin super().__init__(name, default=default) self.type = type self.separator = separator diff --git a/pyproject.toml b/pyproject.toml index 0c45d2e36..07ebdc189 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -195,6 +195,7 @@ ignore = [ "PT004", "PT011", # TODO: add match parameter "RUF012", # ClassVar required if mutable + "ISC001", # conflicts with formatter ] flake8-unused-arguments.ignore-variadic-names = true