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

STY: Bump ruff; use ruff's docstring/code formatting #56554

Closed
wants to merge 24 commits into from

Conversation

mroeschke
Copy link
Member

Looks like ruff now has the ability to replace black and format docstring examples too.

Appears there are some formatting differences but they appear minor IMO and at least the format requires no manual adjusting

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label Dec 18, 2023
pyproject.toml Outdated Show resolved Hide resolved
@mroeschke mroeschke added this to the 3.0 milestone Dec 27, 2023
Comment on lines -66 to -67
MSG='Partially validate docstrings (EX03)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=EX03 --ignore_functions \
Copy link
Member

Choose a reason for hiding this comment

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

are you sure we can remove this? this checks for flake8 errors within docstrings, but it depends on the docstrings having been built in the first place using the fancy @doc decorator, which ruff format doesn't check

@@ -368,6 +349,10 @@ exclude = [
# Keep this one enabled
"pandas/_typing.py" = ["TCH"]

[tool.ruff.format]
docstring-code-format = true
Copy link
Member

Choose a reason for hiding this comment

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

Personally, I like to replace as much with ruff as possible :) but it might be faster to have one PR to replace black and a second one for the doc formatting (I believe black isn't used for that?).

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Opened up #56704 to just replace black

@mroeschke mroeschke closed this Jan 2, 2024
@mroeschke mroeschke deleted the sty/ruff/docstrings branch January 2, 2024 22:23
@mroeschke mroeschke removed this from the 3.0 milestone Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants