Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: switch to ruff-format #663

Merged
merged 1 commit into from
Nov 1, 2023
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
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions plumbum/cli/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
)
Expand Down
3 changes: 2 additions & 1 deletion plumbum/cli/switches.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions plumbum/typed_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down