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

Use the clang-format pre-commit hook updated to the latest version #2039

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

kounelisagis
Copy link
Member

@kounelisagis kounelisagis commented Aug 16, 2024

Currently, clang-format runs only on linux in a non-standard way:

- name: Check formatting (linux only)'
run: |
source $GITHUB_WORKSPACE/ci/scripts/check_formatting_linux.sh
shell: bash
if: ${{ runner.os == 'Linux' }}

It should be better to use the pypi edition of it: https://pypi.org/project/clang-format/ which also provides pre-commit hook and it's system agnostic.

This PR:

  • Introduces the previously mentioned pre-commit hook.
  • Copies the .clang-format file from TileDB-SOMA.
  • Removes the old method/scripts of executing clang-format.
  • Updates all actions/setup-python instances to version 5.
  • Updates all actions/checkout instances to version 4.
  • Updates ruff and black to their latest versions.
  • Reformats the code to reflect the changes above.

[sc-43783]

@kounelisagis kounelisagis requested a review from ihnorton August 16, 2024 11:01
@kounelisagis kounelisagis force-pushed the agis/update-clang-format branch from bfdba6d to 3c4e5cf Compare August 16, 2024 11:08
@kounelisagis kounelisagis changed the title Update clang-format to 17 Update clang-format to 18 Aug 16, 2024
@kounelisagis kounelisagis force-pushed the agis/update-clang-format branch 2 times, most recently from 84b42e2 to 10a8ebf Compare August 16, 2024 12:19
@johnkerl
Copy link
Contributor

@kounelisagis @ihnorton can we perhaps have a discussion about syncing clang-format version changes across packages?

For those of us doing development on a single repo, whatever version the repo is using, the developer can easily switch to.

For those of us doing multi-repo development -- and given that clang-format 14 disagrees with clang-format 18 -- we could have a situation where a given developer needs to switch clang-format versions back & forth when pushing PRs to different packages.

I'm aware of personally:

  • Core
  • TileDB-Py
  • TileDB-SOMA
  • TileDB-VCF
  • and perhaps others

I'm all in favor of moving "into the future" -- just flagging the opportunity for a synchronize (unless there is such underway and I've missed it).

@kounelisagis kounelisagis marked this pull request as draft August 18, 2024 00:40
@kounelisagis kounelisagis force-pushed the agis/update-clang-format branch from 10a8ebf to d0d9790 Compare January 27, 2025 20:15
@kounelisagis kounelisagis changed the title Update clang-format to 18 Use clang-format pre-commit hook and update to the latest version Jan 27, 2025
@kounelisagis kounelisagis marked this pull request as ready for review January 27, 2025 22:00
@kounelisagis kounelisagis requested a review from johnkerl January 27, 2025 22:00
@kounelisagis kounelisagis changed the title Use clang-format pre-commit hook and update to the latest version Use the clang-format pre-commit hook updated to the latest version Jan 27, 2025
@kounelisagis kounelisagis force-pushed the agis/update-clang-format branch from 9c4326a to 4edd287 Compare February 4, 2025 22:14
@kounelisagis
Copy link
Member Author

Rebased onto the main branch

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.

3 participants