Fix to use the function fix_file() separately with options parameter #721
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolved issue (
AttributeError: 'dict' object has no attribute 'in_place' if tried
) for usingfix_file()
in python script with options as dictionary.Can use
autopep8.fix_file(python_file_name, options={'in_place': True, "aggressive": 2}, apply_config=True)
now.Details as per guidelines:
Does not involve
pycodestyle
toolautopep8 --version
autopep8 2.0.4
pycodestyle --version
2.11.1
python --version
Python 3.11.4
Not on Unix
Error while using below code directly using imports
autopep8.fix_file(python_file_name, options={'in_place': True, "aggressive": 2}, apply_config=True)
Getting:
AttributeError: 'dict' object has no attribute 'in_place'
Not using autopep8 command
The implementation should not raise an error
Using the latest release