Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#6290)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 22.1.0 → 22.3.0](psf/black@22.1.0...22.3.0)
- [github.com/pre-commit/mirrors-mypy: v0.931 → v0.942](pre-commit/mirrors-mypy@v0.931...v0.942)
- [github.com/asottile/pyupgrade: v2.31.0 → v2.31.1](asottile/pyupgrade@v2.31.0...v2.31.1)

* mypy --exclude=scripts/solr_builder/solr_builder/fn_to_cli.py

* args as list

* Placate mypy with # type: ignore

* pre-commit autoupdate

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
  • Loading branch information
pre-commit-ci[bot] and cclauss authored Apr 4, 2022
1 parent 9385aab commit 55f5163
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
- --markdown-linebreak-ext=md

- repo: https://github.com/psf/black
rev: 22.1.0
rev: 22.3.0
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
Expand All @@ -41,7 +41,7 @@ repos:
- id: codespell # See setup.cfg for args

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.931'
rev: 'v0.942'
hooks:
- id: mypy
args:
Expand All @@ -51,7 +51,7 @@ repos:
- types-all

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
rev: v2.31.1
hooks:
- id: pyupgrade
args:
Expand Down
6 changes: 3 additions & 3 deletions scripts/solr_builder/solr_builder/fn_to_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, fn: typing.Callable):
defaults = fn.__defaults__ or [] # type: ignore
num_required = len(arg_names) - len(defaults)
default_args = arg_names[num_required:]
defaults = {
defaults = { # type: ignore
arg: default
for [arg, default] in zip(default_args, defaults)
}
Expand All @@ -52,7 +52,7 @@ def __init__(self, fn: typing.Callable):
if arg in annotations:
arg_opts = self.type_to_argparse(annotations[arg])
elif arg in defaults:
arg_opts = self.type_to_argparse(type(defaults[arg]))
arg_opts = self.type_to_argparse(type(defaults[arg])) # type: ignore
else:
raise ValueError(f'{arg} has no type information')

Expand All @@ -61,7 +61,7 @@ def __init__(self, fn: typing.Callable):

if optional:
opt_name = f'--{cli_name}' if len(cli_name) > 1 else f'-{cli_name}'
self.parser.add_argument(opt_name, default=defaults[arg], **arg_opts)
self.parser.add_argument(opt_name, default=defaults[arg], **arg_opts) # type: ignore
else:
self.parser.add_argument(cli_name, **arg_opts)

Expand Down

0 comments on commit 55f5163

Please sign in to comment.