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

[Autofix error] Fails to fix file which formats output #3627

Closed
qarmin opened this issue Mar 20, 2023 · 2 comments · Fixed by #3636
Closed

[Autofix error] Fails to fix file which formats output #3627

qarmin opened this issue Mar 20, 2023 · 2 comments · Fixed by #3636
Labels
bug Something isn't working

Comments

@qarmin
Copy link

qarmin commented Mar 20, 2023

Ruff a45753f

class AbstractFolderIO:
    def __repr__(self):
        return'<%s: %s>' % (self.__class__.__name__, self.path)

with

ruff file.py --fix
error: Autofix introduced a syntax error. Reverting all changes.

This indicates a bug in `ruff`. If you could open an issue at:

    https://github.com/charliermarsh/ruff/issues/new?title=%5BAutofix%20error%5D

...quoting the contents of `Desktop/RunEveryCommand/Ruff/Broken/23027file_io (3rd copy)0.py`, along with the `pyproject.toml` settings and executed command, we'd be very appreciative!

Desktop/RunEveryCommand/Ruff/Broken/23027file_io (3rd copy)0.py:1:1: INP001 File `Desktop/RunEveryCommand/Ruff/Broken/23027file_io (3rd copy)0.py` is part of an implicit namespace package. Add an `__init__.py`.
Desktop/RunEveryCommand/Ruff/Broken/23027file_io (3rd copy)0.py:1:1: D100 Missing docstring in public module
Desktop/RunEveryCommand/Ruff/Broken/23027file_io (3rd copy)0.py:1:7: D101 Missing docstring in public class
Desktop/RunEveryCommand/Ruff/Broken/23027file_io (3rd copy)0.py:2:9: ANN204 Missing return type annotation for special method `__repr__`
Desktop/RunEveryCommand/Ruff/Broken/23027file_io (3rd copy)0.py:2:9: D105 Missing docstring in magic method
Desktop/RunEveryCommand/Ruff/Broken/23027file_io (3rd copy)0.py:2:18: ANN101 Missing type annotation for `self` in method
Desktop/RunEveryCommand/Ruff/Broken/23027file_io (3rd copy)0.py:3:15: Q000 Single quotes found but double quotes preferred
Desktop/RunEveryCommand/Ruff/Broken/23027file_io (3rd copy)0.py:3:15: UP031 Use format specifiers instead of percent format

@qarmin
Copy link
Author

qarmin commented Mar 20, 2023

Maybe same problem

def aix_platform(osname, version, release):
    return"{}-{}.{}".format(osname, version, release)

@charliermarsh charliermarsh added the bug Something isn't working label Mar 20, 2023
@charliermarsh
Copy link
Member

Yeah definitely. We need to add a space here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants