Antti Kaihola
Antti Kaihola
[Darker](https://pypi.org/project/darker/) is one of the tools which [invoke `format_str()`](https://github.com/akaihola/darker/blob/7e07535df598cedb230206c78d8cf04bb30448da/src/darker/black_diff.py#L131) directly for performance reasons. It would be nice to be able to rely on that to remain a stable part of...
In akaihola/darker#164 ([comment](https://github.com/akaihola/darker/issues/164#issuecomment-882014824)) we noticed that `format_str()` gives different results for some files than running `black` from the command line or `black.main(..., standalone_mode=False)`. This should probably be fixed before making...
>`format_str()` gives different results From [`black/__init__.py`](https://github.com/psf/black/blob/65abd1006bca13aa5fc12b173bf206dc261bd592/src/black/__init__.py#L829-832) it's clear why this is the case: ```python if not src_contents.strip(): raise NothingChanged dst_contents = format_str(src_contents, mode=mode) ``` So actually `format_file_contents()` will return results...
Hi all, If Black were to commit to a public API, what's your hunch about which functions will be included in it? I'd like to fix the inconsistent results on...
Thanks @felix-hilden! >Currently, the best candidate we have is probably: >```python >def format_file_contents(src_contents: str, *, fast: bool, mode: Mode) -> FileContent: >``` In [Darker](https://github.com/akaihola/darker), we use `black.format_str()` but could just...
[Darker](https://github.com/akaihola/darker/) is a tool which applies Black reformatting only to lines it detects as having been modified after the latest commit (or since a given commit, or between given commits)....
Also, as I mentioned in microsoft/vscode-black-formatter#176, Darker can already act as a drop-in replacement for Black as a code formatter in VSCode (and various other IDEs, see [Editor integration](https://github.com/akaihola/darker/blob/4a3b01fd95cf0ee6e5c5d0b614e66bcd49c9a94b/README.rst#editor-integration) in...
This should be pretty straightforward to do by converting `.ipynb` to `.py` with `jupyter nbconvert --to=python` and examining imports there.
Hi @qubidt, thanks for the suggestion! Yes, this sounds like a good idea if it enables use of Darker in yet another development environment. Since you mentioned [ALE](https://github.com/dense-analysis/ale), do you...
> ALE has built in support for [many formatters](https://github.com/dense-analysis/ale/blob/master/supported-tools.md), (among them isort and black). Most of them support a stdin mode (some require some equivalent of a `--stdin-filepath` like parameter)....