-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaking change to configuration logic in v2.1.0 #251
Comments
Hi @kevinr-electric, thanks for reporting. I'm going to revert that change and then we can have a separate flag that's exclusive for the location of pyproject.toml. Currently, autoflake doesn't keep a changelog in a dedicated location. We can introduce something with GitHub releases though. |
Hey @fsouza, thanks for the update. A releases section with release notes would also be appreciated! |
I'm confused here; Passing a toml file to |
In version 2.1.1, I'm seeing that [autoflake] works, but [tool.autoflake] does not for a pyproject.toml file. This is in direct contradiction to the PyPi docs |
@joeyagreco can you share an example? I can't repro it:
|
Sure! @fsouza Here's my [autoflake]
ignore_init_module_imports = true
in_place = true
recursive = true
remove_all_unused_imports = true Check version % autoflake --version
> autoflake 2.1.1 Run it % autoflake --config=pyproject.toml .
> Works (removes an unused import) Let's change the [tool.autoflake]
ignore_init_module_imports = true
in_place = true
recursive = true
remove_all_unused_imports = true Now let's run it again % autoflake --config=pyproject.toml .
> can't parse config file 'C:\foo\baz\pyproject.toml' |
@joeyagreco ahh ok, yes |
Sorry, I had missed this message, but I assume people were relying on the fact that simple toml files can be parsed as ini files. After thinking about this a little bit, I feel like we can roll #249 forward again. Alternatively, we could have a dedicated flag for pyproject.toml. |
By changing the config file resolution for .toml files, this new minor version has broken configuration in cases where the
--config
CLI argument is used.In the new version's changes, in the
merge_configuration_file
function on line 1199 autoflake now calls theprocess_pyproject_toml
function for .toml files instead theprocess_config_file
function. The result is that the tool will now try to get the "tool.autoflake" section section instead of the "autoflake" section. In other words, a configuration file that worked with v2.0.2 breaks on v2.1.0 (and vice versa).As an aside, is there a place where release notes are posted? I couldn't find them on GH or Pypi.
The text was updated successfully, but these errors were encountered: