Merge pull request #1712 from pallets/pre-commit-ci-update-config
Before adoption: this commit came in with the history the project adopted, so no landing records it.
[pre-commit.ci] pre-commit autoupdate
authored by David Lord · committed by GitHub · parents 506e4eb, 3f44bac · Browse files · 6 files·+20 added−26 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
6 files+20 added−26 removed
- tests:+13 added−19 removed
- other:+7 added−7 removed
Provenance
- Commit
a28048f- Tree
6a8e8bc- Author
David Lord <davidism@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
506e4eb- Parent 2
3f44bac
6 files changed+20 added−26 removed
modified:src/click/globals.py+1 added-1 removed
34 unmodified lines35 _local.stack.pop()36 37 38 def resolve_color_default(color=None):39- """"Internal helper to get the default value of the color flag. If a39+ """Internal helper to get the default value of the color flag. If a40 value is passed it's returned unchanged, otherwise it's looked up from41 the current context.42 """43 if color is not None:4 unmodified linesmodified:tests/test_formatting.py+9 added-13 removed
50 unmodified lines51 52 def test_wrapping_long_options_strings(runner):53 @click.group()54 def cli():55- """Top level command56- """55+ """Top level command"""56 57 @cli.group()58 def a_very_long():60- """Second level61- """59+ """Second level"""60 61 @a_very_long.command()62 @click.argument("first")63 @click.argument("second")1 unmodified line65 @click.argument("fourth")66 @click.argument("fifth")67 @click.argument("sixth")68 def command():71- """A command.72- """69+ """A command."""70 71 # 54 is chosen as a length where the second line is one character72 # longer than the maximum length.73 result = runner.invoke(cli, ["a-very-long", "command", "--help"], terminal_width=54)12 unmodified lines86 87 def test_wrapping_long_command_name(runner):88 @click.group()89 def cli():93- """Top level command94- """90+ """Top level command"""91 92 @cli.group()93 def a_very_very_very_long():98- """Second level99- """94+ """Second level"""95 96 @a_very_very_very_long.command()97 @click.argument("first")98 @click.argument("second")1 unmodified line100 @click.argument("fourth")101 @click.argument("fifth")102 @click.argument("sixth")103 def command():109- """A command.110- """104+ """A command."""105 106 result = runner.invoke(107 cli, ["a-very-very-very-long", "command", "--help"], terminal_width=54108 )12 unmodified lines121 122 def test_formatting_empty_help_lines(runner):123 @click.command()124 def cli():125+ # fmt: off126 """Top level command127 128 """129+ # fmt: on130 131 result = runner.invoke(cli, ["--help"])132 assert not result.exception133 assert result.output.splitlines() == [167 unmodified lines301 @click.option("-f", "in_file", default="out.txt", help="Output file name")302 def cli():303 pass304 309- result = runner.invoke(cli, ["--help"],)305+ result = runner.invoke(cli, ["--help"])306 assert result.output.splitlines() == [307 "Usage: cli [OPTIONS]",308 "",309 "Options:",45 unmodified linesmodified:tests/test_options.py+2 added-2 removed
486 unmodified lines487 )488 def cmd(config):489 pass490 491- result = runner.invoke(cmd, ["--help"],)491+ result = runner.invoke(cmd, ["--help"])492 assert result.exit_code == 0493 i = " " * 21494 assert (495 " -C, --config PATH Configuration file to use.\n"156 unmodified lines652 """When a boolean flag only has one opt, it will show the default653 value, not the opt name.654 """655 opt = click.Option(656- ("--cache",), is_flag=True, show_default=True, help="Enable the cache.",656+ ("--cache",), is_flag=True, show_default=True, help="Enable the cache."657 )658 ctx = click.Context(click.Command("test"))659 message = opt.get_help_record(ctx)[1]660 assert "[default: False]" in message31 unmodified linesmodified:tests/test_shell_completion.py+1 added-3 removed
261 unmodified lines262 "click.shell_completion.BashComplete._check_version", lambda self: True263 )264 265 266-@pytest.mark.parametrize(267- "shell", ["bash", "zsh", "fish"],268-)266+@pytest.mark.parametrize("shell", ["bash", "zsh", "fish"])267 @pytest.mark.usefixtures("_patch_for_completion")268 def test_full_source(runner, shell):269 cli = Group("cli", commands=[Command("a"), Command("b")])270 result = runner.invoke(cli, env={"_CLI_COMPLETE": f"{shell}_source"})44 unmodified linesmodified:tests/test_termui.py+1 added-1 removed
378 unmodified lines379 assert click.getchar() == f"{special_key_char}{key_char}"380 381 382 @pytest.mark.parametrize(383- ("key_char", "exc"), [("\x03", KeyboardInterrupt), ("\x1a", EOFError)],383+ ("key_char", "exc"), [("\x03", KeyboardInterrupt), ("\x1a", EOFError)]384 )385 @pytest.mark.skipif(not WIN, reason="Tests user-input using the msvcrt module.")386 def test_getchar_windows_exceptions(runner, monkeypatch, key_char, exc):387 monkeypatch.setattr(click._termui_impl.msvcrt, "getwch", lambda: key_char)61 unmodified linesmodified:.pre-commit-config.yaml+6 added-6 removed
123345678891011121312131415161717181920212223242425262728repos: - repo: https://github.com/asottile/pyupgrade rev: v2.4.3 rev: v2.10.0 hooks: - id: pyupgrade args: ["--py36-plus"] - repo: https://github.com/asottile/reorder_python_imports rev: v2.3.0 rev: v2.4.0 hooks: - id: reorder-python-imports args: ["--application-directories", "src"] - repo: https://github.com/ambv/black rev: 19.10b0 - repo: https://github.com/psf/black rev: 20.8b1 hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 rev: 3.8.2 rev: 3.8.4 hooks: - id: flake8 additional_dependencies: - flake8-bugbear - flake8-implicit-str-concat - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.1.0 rev: v3.4.0 hooks: - id: check-byte-order-marker - id: trailing-whitespace - id: end-of-file-fixer