Skip to content
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

Fix to use the function fix_file() separately with options parameter #721

Closed
wants to merge 3 commits into from

Conversation

kulkarnisg
Copy link

Resolved issue (AttributeError: 'dict' object has no attribute 'in_place' if tried ) for using fix_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:

  1. Does not involve pycodestyle tool

  2. autopep8 --version
    autopep8 2.0.4

  3. pycodestyle --version
    2.11.1

  4. python --version
    Python 3.11.4

  5. Not on Unix

  6. 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'

  7. Not using autopep8 command

  8. The implementation should not raise an error

  9. Using the latest release

@codecov-commenter
Copy link

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (af7399d) 97.83% compared to head (0e21fe4) 97.79%.

Files Patch % Lines
autopep8.py 50.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #721      +/-   ##
==========================================
- Coverage   97.83%   97.79%   -0.04%     
==========================================
  Files           1        1              
  Lines        2402     2404       +2     
==========================================
+ Hits         2350     2351       +1     
- Misses         52       53       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kulkarnisg kulkarnisg closed this Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants