Skip to content

Commit

Permalink
Revert "Support .toml configuration format with --config flag (#249)"
Browse files Browse the repository at this point in the history
This introduced a breaking change (#251).

This reverts commit 780b44f.
  • Loading branch information
fsouza committed Apr 18, 2023
1 parent fa775bb commit 5071c79
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
6 changes: 1 addition & 5 deletions autoflake.py
Expand Up @@ -1194,11 +1194,7 @@ def merge_configuration_file(flag_args):

if "config_file" in flag_args:
config_file = pathlib.Path(flag_args["config_file"]).resolve()

if config_file.suffix == ".toml":
config = process_pyproject_toml(config_file)
else:
config = process_config_file(config_file)
config = process_config_file(config_file)

if not config:
_LOGGER.error(
Expand Down
26 changes: 0 additions & 26 deletions test_autoflake.py
Expand Up @@ -3385,32 +3385,6 @@ def test_config_option(self):
check=True,
)

def test_config_option_toml(self):
with temporary_file(
suffix=".toml",
contents=(
"[tool.autoflake]\n"
"check = true\n"
'exclude = [\n "build",\n ".venv",\n]'
),
) as temp_config:
self.create_file("test_me.py")
files = [self.effective_path("test_me.py")]

args, success = autoflake.merge_configuration_file(
{
"files": files,
"config_file": temp_config,
},
)
assert success is True
assert args == self.with_defaults(
files=files,
config_file=temp_config,
check=True,
exclude="build,.venv",
)

def test_load_false(self):
self.create_file("test_me.py")
self.create_file(
Expand Down

0 comments on commit 5071c79

Please sign in to comment.