From e4003c2c439fc08a407d3024a195c010f03c4173 Mon Sep 17 00:00:00 2001 From: johnthagen Date: Sat, 10 Apr 2021 08:07:34 -0400 Subject: [PATCH] Exclude venv directory by default (#1683) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Co-authored-by: Łukasz Langa --- CHANGES.md | 2 ++ README.md | 4 ++-- docs/installation_and_usage.md | 4 ++-- src/black/__init__.py | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 97a3be3..6340f60 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -45,6 +45,8 @@ - PR #2053: Python 2 support is now optional, install with `python3 -m pip install black[python2]` to maintain support. +- Exclude `venv` directory by default (#1683) + #### _Packaging_ - Self-contained native _Black_ binaries are now provided for releases via GitHub diff --git a/README.md b/README.md index 0bc0228..ed9f105 100644 --- a/README.md +++ b/README.md @@ -133,8 +133,8 @@ Options: directories on all platforms (Windows, too). Exclusions are calculated first, inclusions later. [default: /(\.direnv|\.eggs|\.git|\. - hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_bu - ild|buck-out|build|dist)/] + hg|\.mypy_cache|\.nox|\.tox|\.venv|venv|\.sv + n|_build|buck-out|build|dist)/] --extend-exclude TEXT Like --exclude, but adds additional files and directories on top of the excluded diff --git a/docs/installation_and_usage.md b/docs/installation_and_usage.md index bb554eb..fcde49f 100644 --- a/docs/installation_and_usage.md +++ b/docs/installation_and_usage.md @@ -87,8 +87,8 @@ Options: directories on all platforms (Windows, too). Exclusions are calculated first, inclusions later. [default: /(\.direnv|\.eggs|\.git|\. - hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_bu - ild|buck-out|build|dist)/] + hg|\.mypy_cache|\.nox|\.tox|\.venv|venv|\.sv + n|_build|buck-out|build|dist)/] --force-exclude TEXT Like --exclude, but files and directories matching this regex will be excluded even diff --git a/src/black/__init__.py b/src/black/__init__.py index 54d6edf..0065bea 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -82,7 +82,7 @@ if TYPE_CHECKING: import colorama # noqa: F401 DEFAULT_LINE_LENGTH = 88 -DEFAULT_EXCLUDES = r"/(\.direnv|\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|\.svn|_build|buck-out|build|dist)/" # noqa: B950 +DEFAULT_EXCLUDES = r"/(\.direnv|\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|venv|\.svn|_build|buck-out|build|dist)/" # noqa: B950 DEFAULT_INCLUDES = r"\.pyi?$" CACHE_DIR = Path(user_cache_dir("black", version=__version__)) STDIN_PLACEHOLDER = "__BLACK_STDIN_FILENAME__" -- 2.39.5