Skip to content

--check should work on paths #151

@madig

Description

@madig

Operating system: Win 10 x86
Python version: 3.6.5 64 bit
Black version: 18.4a2
Does also happen on master: Throws this backtrace instead:

Traceback (most recent call last):
  File "C:\Users\nikolaus.waxweiler\AppData\Local\Python\Python36\Scripts\black-script.py", line 11, in <module>
    load_entry_point('black==18.4a2', 'console_scripts', 'black')()
  File "C:\Users\nikolaus.waxweiler\AppData\Local\Python\Python36\site-packages\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\nikolaus.waxweiler\AppData\Local\Python\Python36\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "C:\Users\nikolaus.waxweiler\AppData\Local\Python\Python36\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\nikolaus.waxweiler\AppData\Local\Python\Python36\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "C:\Users\nikolaus.waxweiler\AppData\Local\Python\Python36\site-packages\click\decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "C:\Users\nikolaus.waxweiler\AppData\Local\Python\Python36\site-packages\black.py", line 211, in main
    sources, line_length, write_back, fast, quiet, loop, executor
  File "c:\program files\python36\lib\asyncio\base_events.py", line 468, in run_until_complete
    return future.result()
  File "C:\Users\nikolaus.waxweiler\AppData\Local\Python\Python36\site-packages\black.py", line 296, in schedule_formatting
    loop.add_signal_handler(signal.SIGINT, cancel, _task_values)
  File "c:\program files\python36\lib\asyncio\events.py", line 499, in add_signal_handler
    raise NotImplementedError
NotImplementedError

Running black . works fine, but black --check . returns the error code 1 instead. It should search for ./**/*.py and check everything. Reason: I'd like to write

[testenv:black]
deps = black
commands = black --check .

in my tox.ini and not worry about exact paths, wildcards, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions