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

autopep8 generates invalid Python 3.9 multi-line f-string formatting #3120

Open
martinhoyer opened this issue Jul 29, 2024 · 0 comments
Open
Labels
code | style Code style changes not affecting functionality command | lint tmt lint command

Comments

@martinhoyer
Copy link
Collaborator

martinhoyer commented Jul 29, 2024

  • original (line-length too long)
            if not node:
                raise tmt.utils.DiscoverError(
                    f"Failed to find plan '{plan_id.name}' at 'url: {plan_id.url}', 'ref: {plan_id.ref}'.")
  • autopep8 (Python 3.9 does not support newlines in non-triple-quoted f-strings)
            if not node:
                raise tmt.utils.DiscoverError(
                    f"Failed to find plan '{
                        plan_id.name}' at 'url: {
                        plan_id.url}', 'ref: {
                        plan_id.ref}'.")
  • ruff format formats it correctly
        if not node:
            raise tmt.utils.DiscoverError(
                f"Failed to find plan '{plan_id.name}' "
                f"at 'url: {plan_id.url}, 'ref: {plan_id.ref}'."
            )

Ruff-format PR: #2844

@martinhoyer martinhoyer added command | lint tmt lint command code | style Code style changes not affecting functionality labels Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code | style Code style changes not affecting functionality command | lint tmt lint command
Projects
None yet
Development

No branches or pull requests

1 participant