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

[Python] Configure pre-commit hook to run ruff on archery and other developer tools #45754

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

kszucs
Copy link
Member

@kszucs kszucs commented Mar 12, 2025

I am aware that this is a somewhat controversial topic, but black/ruff are becoming standard nowadays and can can save us a significant amount of manual work. While cython isn’t supported by either of these tools, we have plenty of pure Python code where we could benefit from modern automatic formatting. I understand that we have different style preferences, but maintaining consistency without an auto formatter is simply too time consuming.

Here I configured ruff to be used on the developer tools under the dev/ directory. I applied formatting and configured a list rules to exclude when running ruff check dev/. Some of these rules would make sense to enable, but I wanted to keep manual edits low for now, we can enable those incrementally in follow-ups.

Copy link

Thanks for opening a pull request!

If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose

Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project.

Then could you also rename the pull request title in the following format?

GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}

or

MINOR: [${COMPONENT}] ${SUMMARY}

See also:

@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Mar 12, 2025
@kszucs
Copy link
Member Author

kszucs commented Mar 12, 2025

Later on we could add other python scripts to ruff formatting, such as:

  • python tools under cpp/
  • maybe even python/**/*.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant