Skip to content

Conversation

@AntoinePrv
Copy link
Contributor

@AntoinePrv AntoinePrv commented Jul 22, 2025

Rationale for this change

Update clang-format to better match modern IDEs.

What changes are included in this PR?

  • Update clang-format
  • Reformat code base with newer version

Are these changes tested?

Yes

Are there any user-facing changes?

No

@github-actions
Copy link

⚠️ GitHub issue #47167 has been automatically assigned in GitHub to PR creator.

@raulcd
Copy link
Member

raulcd commented Jul 22, 2025

The Python failures are unrelated, I just merged the fix on main, if you rebase they will go away.
It seems the newer clang-format pre-commit (from 16.0.0) fails on Ubuntu 22.04 because textproto was added to identify 2.5.20 but Ubuntu seems to be using indentify 2.4.10-1 (https://packages.ubuntu.com/jammy/python3-identify).
@kou is using the system pre-commit a requirement? I am unsure what the discussion was when we moved from archery lint to pre-commit. Some info on when this was added:

@AntoinePrv
Copy link
Contributor Author

Without it, that sends back pre-commit to 15.*

@kou
Copy link
Member

kou commented Jul 23, 2025

Supporting old pre-commit (system pre-commit) is for new contributors on Ubuntu 22.04.

If we have enough documentation (or something) for new contributors, we can require more newer pre-commit (and identify).

@AntoinePrv
Copy link
Contributor Author

pre-commit is very easy to install via either conda or pip. Are there other dependencies we are getting from these sources?

@kou
Copy link
Member

kou commented Jul 24, 2025

apache/arrow has many language implementations. We can't assume that all new contributors are familiar with Python, conda and/or pip.

For example, this thread #46686 (comment) considered about new R contributors.

@AntoinePrv
Copy link
Contributor Author

A possible direction to help both could be to leverage pixi.

I'm using it locally and in many other projects (C++/Rust/Python): it combines conda dependencies and run commands in managed environments.

Once installed (which is fairly easy IMHO), a one command pixi run lint, pixi run test etc. could download and install all required dependencies as needed, execute intermediary steps (with caching), and run the commands.
What's great is that all type of dependencies (Python itself, R, compilers...) can be pulled, on all platforms.
In the case of pre-commit, I've already set it up to lint/format with the same executable used for both one-stop command, and through pre-commit.

I'm not claiming it could handle all Arrow development cases, but it certainly make for a great on-boarding.
Using it also does not prevent from not using it.
I've been meaning to write a blog post about how I use it in development. If that seems like an interesting direction, I could come back when done, and will be willing to contribute a configuration.

@kou
Copy link
Member

kou commented Jul 25, 2025

I don't have a strong opinion how to care about new contributors. I don't object the Pixi (or pip) approach if we have the official document how to prepare pre-commit with Pixi or something.
I chose the supporting system pre-commit approach just because we don't need to write additional document how to prepare pre-commit.

It may be better that we start a discussion thread on [email protected] https://lists.apache.org/[email protected] to collect more opinions.

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.

3 participants