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
Arbitrary arguments to Black aren't yet supported.
Darker invokes Black directly through its internal Python API. The Black configuration is actually first read by Darker, and some options are passed on to Black. But for example --preview isn't currently one of those options, while it would be useful for some use cases (see #350 for discussion on how to pass --preview to Black).
We should implement support for e.g. --black-options="--preview ..." to allow passing arbitrary extra arguments to Black. An alternative name would be --extra-black-options="..." – this is to be decided.
It's unclear whether it's possible to easily pass all options in --black-options="..." when calling Black via its Python API. If not, that may ruin the whole idea.
This is a bit related to #244 (--config and find_project_root()), too.
#589 now has an implementation of a separate --preview option. Discussion on the choice between dedicated options and something like --extra-black-options= is best continued in #589.
I configured black to ignore a folder but darker pre-commit hook doesn't appear to be ignoring changes to that folder. Is this expected? Config option to do this would be handy.
@brtknr, if that's the case, we should investigate.
If you run Black in a pre-commit hook with a similar folder ignore configuration, does it ignore that folder?
If pre-commit calls Darker separately for each file, it shouldn't respect Black's file/folder ignore configuration. But in that case I would think Black shouldn't work either, since I'm pretty sure I tried to mirror Black's behavior here.
Related changes in Darker:
#146 was fixed in #171 and released in version 1.3.0:
Skip reformatting files set to be excluded by Black in configuration files.
#104 was fixed in #215 and released in version 1.3.2.
Change log entry:
Honor exclusion patterns from Black configuration when choosing files to reformat. This only applies when recursing directories specified on the command line, and only affects Black reformatting, not isort or linters.
PR description:
Unify exclusion behavior with Black: the exclude options from Black configuration only apply to directories listed on the command line, but not to files. Closes #104.
Arbitrary arguments to Black aren't yet supported.
Darker invokes Black directly through its internal Python API. The Black configuration is actually first read by Darker, and some options are passed on to Black. But for example
--preview
isn't currently one of those options, while it would be useful for some use cases (see #350 for discussion on how to pass--preview
to Black).We should implement support for e.g.
--black-options="--preview ..."
to allow passing arbitrary extra arguments to Black. An alternative name would be--extra-black-options="..."
– this is to be decided.It's unclear whether it's possible to easily pass all options in
--black-options="..."
when calling Black via its Python API. If not, that may ruin the whole idea.This is a bit related to #244 (
--config
andfind_project_root()
), too.#589 now has an implementation of a separate
--preview
option. Discussion on the choice between dedicated options and something like--extra-black-options=
is best continued in #589.Originally posted by @akaihola in #350 (comment)
The text was updated successfully, but these errors were encountered: