Skip to content

Conversation

@cclauss
Copy link
Contributor

@cclauss cclauss commented Dec 13, 2024

Fixes: #14449

Use ruff format to format Python code. https://docs.astral.sh/ruff/formatter

Settings in pyproject.toml are all subject to discussion:

format.quote-style = "preserve"
indent-width = 2
line-length = 120
  • Add a ruff format command after the existing ruff check test in CircleCI.
  • Remove .style.yapf because maintainers should agree on a single Python code formatter.
  • Format suppression: comments can be used to preserve formatting. # fmt: off and # fmt: on

Any hints on the CircleCI: build-docs failure?


parameterize(metafunc, {'': (None,),
'nodefs': ('nodefs',)})
parameterize(metafunc, {'': (None,), 'nodefs': ('nodefs',)})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these uses of parameterize are deliberately spread so that there is one test case per line. Its important for readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the format suppression comment in the commit message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a trailing comma after the last dict item will cause ruff format to make things clear.

Suggested change
parameterize(metafunc, {'': (None,), 'nodefs': ('nodefs',)})
parameterize(
metafunc,
{
'': (None,),
'nodefs': ('nodefs',),
},
)

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.

Auto-format Python code

2 participants