This is question I guess. I'm trying to run black on all Python files in a repository using:
black --check *
Which seems like a pretty common use-case. But there are .json (and other non-Python) files in that main directory and they are getting caught too. I tried excluding JSON files specifically:
black --check --exclude '\.json$' *
But that didn't change anything. I understand that the include/exclude options only happen for recursively reformatting and that maybe because they are in the root directory they aren't thought of as recursive targets.
This basically gets me what I want but it feels like there's a better way and I'm missing something obvious:
find . -name \*\.py |xargs black --check
Operating system: MacOS Mojave
Python version: 3.6
Black version: 19.3b0
Does also happen on master: yes
To answer the last question, you have two options:
pip install -e .;python setup.py test; andblack like you did last time.Uh, yeah I figured it out 2 minutes later:
black --check .
Most helpful comment
Uh, yeah I figured it out 2 minutes later:
black --check .