Loading CHANGES.md +1 −0 Changes for CHANGES.md: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ - Add support for formatting Jupyter Notebook files (#2357) - Move from `appdirs` dependency to `platformdirs` (#2375) - Present a more user-friendly error if .gitignore is invalid (#2414) ### Integrations Loading setup.py +1 −1 Changes for setup.py: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ def get_long_description() -> str: "tomli>=0.2.6,<2.0.0", "typed-ast>=1.4.2; python_version < '3.8'", "regex>=2020.1.8", "pathspec>=0.8.1, <1", "pathspec>=0.9.0, <1", "dataclasses>=0.6; python_version < '3.7'", "typing_extensions>=3.10.0.0; python_version < '3.10'", "mypy_extensions>=0.4.3", Loading src/black/__init__.py +4 −0 Changes for src/black/__init__.py: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ from multiprocessing import Manager, freeze_support import os from pathlib import Path from pathspec.patterns.gitwildmatch import GitWildMatchPatternError import regex as re import signal import sys Loading Loading @@ -428,6 +429,7 @@ def main( content=code, fast=fast, write_back=write_back, mode=mode, report=report ) else: try: sources = get_sources( ctx=ctx, src=src, Loading @@ -440,6 +442,8 @@ def main( report=report, stdin_filename=stdin_filename, ) except GitWildMatchPatternError: ctx.exit(1) path_empty( sources, Loading src/black/files.py +5 −0 Changes for src/black/files.py: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ ) from pathspec import PathSpec from pathspec.patterns.gitwildmatch import GitWildMatchPatternError import tomli from black.output import err Loading Loading @@ -122,7 +123,11 @@ def get_gitignore(root: Path) -> PathSpec: if gitignore.is_file(): with gitignore.open(encoding="utf-8") as gf: lines = gf.readlines() try: return PathSpec.from_lines("gitwildmatch", lines) except GitWildMatchPatternError as e: err(f"Could not parse {gitignore}: {e}") raise def normalize_path_maybe_ignore( Loading tests/data/invalid_gitignore_tests/.gitignore 0 → 100644 +1 −0 Changes for tests/data/invalid_gitignore_tests/.gitignore: 1 added line, 0 removed lines. Original line number Diff line number Diff line ! Loading
CHANGES.md +1 −0 Changes for CHANGES.md: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ - Add support for formatting Jupyter Notebook files (#2357) - Move from `appdirs` dependency to `platformdirs` (#2375) - Present a more user-friendly error if .gitignore is invalid (#2414) ### Integrations Loading
setup.py +1 −1 Changes for setup.py: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ def get_long_description() -> str: "tomli>=0.2.6,<2.0.0", "typed-ast>=1.4.2; python_version < '3.8'", "regex>=2020.1.8", "pathspec>=0.8.1, <1", "pathspec>=0.9.0, <1", "dataclasses>=0.6; python_version < '3.7'", "typing_extensions>=3.10.0.0; python_version < '3.10'", "mypy_extensions>=0.4.3", Loading
src/black/__init__.py +4 −0 Changes for src/black/__init__.py: 4 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ from multiprocessing import Manager, freeze_support import os from pathlib import Path from pathspec.patterns.gitwildmatch import GitWildMatchPatternError import regex as re import signal import sys Loading Loading @@ -428,6 +429,7 @@ def main( content=code, fast=fast, write_back=write_back, mode=mode, report=report ) else: try: sources = get_sources( ctx=ctx, src=src, Loading @@ -440,6 +442,8 @@ def main( report=report, stdin_filename=stdin_filename, ) except GitWildMatchPatternError: ctx.exit(1) path_empty( sources, Loading
src/black/files.py +5 −0 Changes for src/black/files.py: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ ) from pathspec import PathSpec from pathspec.patterns.gitwildmatch import GitWildMatchPatternError import tomli from black.output import err Loading Loading @@ -122,7 +123,11 @@ def get_gitignore(root: Path) -> PathSpec: if gitignore.is_file(): with gitignore.open(encoding="utf-8") as gf: lines = gf.readlines() try: return PathSpec.from_lines("gitwildmatch", lines) except GitWildMatchPatternError as e: err(f"Could not parse {gitignore}: {e}") raise def normalize_path_maybe_ignore( Loading
tests/data/invalid_gitignore_tests/.gitignore 0 → 100644 +1 −0 Changes for tests/data/invalid_gitignore_tests/.gitignore: 1 added line, 0 removed lines. Original line number Diff line number Diff line !