Closed ADKosm closed 5 years ago
Rather than tests/test_cases/with_black_configuration/
could you use tests/with_pyproject_toml/
instead (not a nested folder).
My naming suggestion here is to then be able to add tests/with_dot_flake8/
and tests/with_dot_flake8/.flake8
with the configuration (e.g. could try varying the line length here).
Does it make sense to support skip_string_normalization
via flake8's configuration file(s), .flake8
etc?
Rather than
tests/test_cases/with_black_configuration/
could you usetests/with_pyproject_toml/
instead (not a nested folder).My naming suggestion here is to then be able to add
tests/with_dot_flake8/
andtests/with_dot_flake8/.flake8
with the configuration (e.g. could try varying the line length here).Does it make sense to support
skip_string_normalization
via flake8's configuration file(s),.flake8
etc?
with_pyproject_toml
:) (unfortunately, there is no file like CONTRIBUTIONS with some convetions about project)Not every Flake8 command-line option can be specified in the configuration file. See our list of options to determine which options will be parsed from the configuration files.
This means, that there is predefined options, which we can use in .flake8
- https://flake8.pycqa.org/en/latest/user/options.html#options-list .
Moreover, if user uses black with skip_string_normalization
, he must define this property in pyproject.toml because original black tool use only this config file. This means, that using skip_string_normalization
in .flake8
is useless dublication.
My understanding is plugins can add their own settings to .flake8
, setup.cfg
, or tox.ini
- but agree given the very clear expectation of black settings being in pyproject.toml
we should prioritise that.
Are you happy to be thanked by name in the release notes etc, something like here: https://github.com/peterjc/flake8-rst-docstrings
I'm going to tweak the message wording, update the README, and bump the version for a new release. I would like to acknowledge you by name if that's OK?
@peterjc yes, of course :)
This PR adds reading file mode configuration from black section in pyproject.toml (see https://black.readthedocs.io/en/stable/pyproject_toml.html).
Main motivation is support for
skip-string-normalization
option. Without this flag flake8 will always fails on large and other specific projects, which disable string normalization ( see this section in offitial black README - https://github.com/python/black#strings).