How to use the invocations.checks.blacken function in invocations

To help you get started, we’ve selected a few invocations examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyinvoke / invocations / tests / checks.py View on Github external
def folders_configurable(self, ctx):
            # Just config -> works fine
            ctx.blacken = dict(folders=["elsewhere"])
            blacken(ctx)
            assert "elsewhere" in ctx.run_command
github pyinvoke / invocations / tests / checks.py View on Github external
def find_opts_config_loses_to_runtime(self, ctx):
            ctx.blacken = dict(find_opts="-and -not -name foo.py")
            blacken(ctx, find_opts="-or -name '*.js'")
            assert "find . -name '*.py' -or -name '*.js'" in ctx.run_command
github pyinvoke / invocations / tests / checks.py View on Github external
def runs_black(self, ctx, kwargs, command):
            blacken(ctx, **kwargs)
            ctx.run.assert_called_once_with(command, pty=True)
github pyinvoke / invocations / tests / checks.py View on Github external
def find_opts_configurable(self, ctx):
            ctx.blacken = dict(find_opts="-and -not -name foo.py")
            blacken(ctx)
            assert (
                "find . -name '*.py' -and -not -name foo.py" in ctx.run_command
            )
github pyinvoke / invocations / tests / checks.py View on Github external
def folders_config_loses_to_runtime(self, ctx):
            # Config + CLI opt -> CLI opt wins
            ctx.blacken = dict(folders=["nowhere"])
            blacken(ctx, folders=["nowhere"])
            assert "nowhere" in ctx.run_command
github fabric / fabric / tasks.py View on Github external
module=None,
):
    return integration_(
        c, opts, pty, x, k, verbose, color, capture, module,
    )


# Better than nothing, since we haven't solved "pretend I have some other
# task's signature" yet...
publish.__doc__ = release.publish.__doc__
my_release = Collection(
    "release", release.build, release.status, publish, release.prepare
)

ns = Collection(
    blacken,
    coverage,
    docs,
    integration,
    my_release,
    sites,
    test,
    travis,
    watch_docs,
    www,
)
ns.configure(
    {
        "tests": {
            # TODO: have pytest tasks honor these?
            "package": "fabric",
            "logformat": LOG_FORMAT,
github pyinvoke / invoke / tasks.py View on Github external
# arg.
    return coverage_(c, report=report, opts=opts, tester=test)


ns = Collection(
    test,
    coverage,
    integration,
    vendorize,
    release,
    www,
    docs,
    sites,
    watch_docs,
    travis,
    checks.blacken,
)
ns.configure(
    {
        "blacken": {
            # Skip the vendor directory and the (Travis-only) alt venv when
            # blackening.
            # TODO: this is making it seem like I really do want an explicit
            # arg/conf-opt in the blacken task for "excluded paths"...ha
            "find_opts": "-and -not \( -path './invoke/vendor*' -or -path './alt_env*' -or -path './build*' \)"  # noqa
        },
        "tests": {"logformat": LOG_FORMAT, "package": "invoke"},
        "travis": {
            "sudo": {"user": "sudouser", "password": "mypass"},
            "black": {"version": "18.6b4"},
        },
        "packaging": {