]>
git.madduck.net Git - etc/vim.git/blobdiff - src/black/__init__.py
madduck's git repository
Every one of the projects in this repository is available at the canonical
URL git://git.madduck.net/madduck/pub/<projectpath> — see
each project's metadata for the exact URL.
All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@ git. madduck. net .
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
SSH access, as well as push access can be individually
arranged .
If you use my repositories frequently, consider adding the following
snippet to ~/.gitconfig and using the third clone URL listed for each
project:
[url "git://git.madduck.net/madduck/"]
insteadOf = madduck:
import click
from click.core import ParameterSource
from mypy_extensions import mypyc_attr
import click
from click.core import ParameterSource
from mypy_extensions import mypyc_attr
+from pathspec import PathSpec
from pathspec.patterns.gitwildmatch import GitWildMatchPatternError
from _black_version import version as __version__
from pathspec.patterns.gitwildmatch import GitWildMatchPatternError
from _black_version import version as __version__
sources: Set[Path] = set()
root = ctx.obj["root"]
sources: Set[Path] = set()
root = ctx.obj["root"]
+ exclude_is_None = exclude is None
+ exclude = re_compile_maybe_verbose(DEFAULT_EXCLUDES) if exclude is None else exclude
+ gitignore = None # type: Optional[PathSpec]
+ root_gitignore = get_gitignore(root)
+
for s in src:
if s == "-" and stdin_filename:
p = Path(stdin_filename)
for s in src:
if s == "-" and stdin_filename:
p = Path(stdin_filename)
sources.add(p)
elif p.is_dir():
sources.add(p)
elif p.is_dir():
- if exclude is None:
- exclude = re_compile_maybe_verbose(DEFAULT_EXCLUDES)
- gitignore = get_gitignore(root)
p_gitignore = get_gitignore(p)
# No need to use p's gitignore if it is identical to root's gitignore
# (i.e. root and p point to the same directory).
p_gitignore = get_gitignore(p)
# No need to use p's gitignore if it is identical to root's gitignore
# (i.e. root and p point to the same directory).
- if gitignore ! = p_gitignore:
- gitignore += p _gitignore
- else:
- gitignore = Non e
+ if root_gitignore = = p_gitignore:
+ gitignore = root _gitignore
+ else:
+ gitignore = root_gitignore + p_gitignor e
sources.update(
gen_python_files(
p.iterdir(),
sources.update(
gen_python_files(
p.iterdir(),