You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--exclude is supposed to only apply to the recursive discovery of files. Not files explicitly passed to Black through the command line. This is a regression since #1032 was merged.
To Reproduce
Create a directory for testing
Create and activate a virtual enviroment
Install Black on master using pip install git+git://github.com/psf/black
Create two empty files:
4.1. pyproject.toml so Black doesn't find a different configuration file up your directory structure
4.2. test.py - this will be our test file
Run black -v --exclude=test.py test.py
Install Black 19.10b0 using pip install black==19.10b0
Run black -v --exclude=test.py test.py
Observe that on master the file was excluded and on stable the file was formatted.
Expected behavior
Black formats test.py since it was explicitly passed through the command line and --exclude should not touch such files like it.
OS and Python version: Ubuntu 18.04.04 LTS and Python 3.8.1
Does this bug also happen on master?
Yes and also N/A - This is a regression
Additional context
I haven't looked into this bug that much, but the problem seems to be related to how even files passed via the command line are given to the recursive gen_python_files function as single Path object lists in get_sources.
Describe the bug
--exclude
is supposed to only apply to the recursive discovery of files. Not files explicitly passed to Black through the command line. This is a regression since #1032 was merged.To Reproduce
pip install git+git://github.com/psf/black
4.1.
pyproject.toml
so Black doesn't find a different configuration file up your directory structure4.2.
test.py
- this will be our test fileblack -v --exclude=test.py test.py
pip install black==19.10b0
black -v --exclude=test.py test.py
Expected behavior
Black formats
test.py
since it was explicitly passed through the command line and--exclude
should not touch such files like it.Environment
19.10b0
)Ubuntu 18.04.04 LTS
andPython 3.8.1
Does this bug also happen on master?
Yes and also N/A - This is a regression
Additional context
I haven't looked into this bug that much, but the problem seems to be related to how even files passed via the command line are given to the recursive
gen_python_files
function as single Path object lists inget_sources
.black/src/black/__init__.py
Lines 605 to 610 in b59a524
The text was updated successfully, but these errors were encountered: