hhatto / autopep8

A tool that automatically formats Python code to conform to the PEP 8 style guide.
https://pypi.org/project/autopep8/
MIT License
4.54k stars 291 forks source link

add pre-commit configuration #679

Closed asottile closed 1 year ago

asottile commented 1 year ago

resolves #678

checked that it worked with pre-commit try-repo:

$ pre-commit try-repo . --files autopep8.py 
[INFO] Initializing environment for ..
===============================================================================
Using config:
===============================================================================
repos:
-   repo: .
    rev: 3c1e0e4e42132e64f9fb088462aab3358677b55b
    hooks:
    -   id: autopep8
===============================================================================
[INFO] Installing environment for ..
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
autopep8.................................................................Failed
- hook id: autopep8
- files were modified by this hook
$ git diff
diff --git a/autopep8.py b/autopep8.py
index 573f7ac..607899d 100755
--- a/autopep8.py
+++ b/autopep8.py
@@ -3662,10 +3662,10 @@ def apply_global_fixes(source, options, where='global', filename='',
                           indent_size=options.indent_size,
                           leave_tabs=not (
                               code_match(
-                                    'W191',
-                                    select=options.select,
-                                    ignore=options.ignore)
-                                         )
+                                  'W191',
+                                  select=options.select,
+                                  ignore=options.ignore)
+                          )
                           )

     for (code, function) in global_fixes():
codecov-commenter commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (6e6d4ba) 97.83% compared to head (3c1e0e4) 97.83%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #679 +/- ## ======================================= Coverage 97.83% 97.83% ======================================= Files 1 1 Lines 2398 2398 ======================================= Hits 2346 2346 Misses 52 52 ``` Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Hideo+Hattori). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Hideo+Hattori)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.