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

Add proper clang-format to pre-commit #1514

Merged
merged 8 commits into from
Oct 6, 2021
Merged

Conversation

Skylion007
Copy link
Contributor

Motivation and Context

  • Makes clang-format a proper pre-commit hook using a new pip package we created for PyBind11
  • Automatically handles clang-format versioning and dependencies with the new hook

How Has This Been Tested

Types of changes

  • Docs change / refactoring / dependency upgrade

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

files: '.*\.(cpp|h|hpp|cu|cuh)$'
language: system
- id: clang-format
types_or: [c++, c, c#, cuda] # also run on CUDA
Copy link
Contributor

Choose a reason for hiding this comment

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

c# ? 🥳

Copy link
Contributor Author

@Skylion007 Skylion007 Oct 4, 2021

Choose a reason for hiding this comment

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

It's supported, so why not. Main issue is that the OG hook doesn't support CUDA as a type, although I am working on getting it fixed.

Other supported languages include JSON btw.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The CUDA type_or is now merged in, but won't be updated until a new release is made of the hook.

Copy link
Contributor

@jturner65 jturner65 left a comment

Choose a reason for hiding this comment

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

LGTM

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Oct 5, 2021
@Skylion007 Skylion007 merged commit 5569026 into main Oct 6, 2021
@Skylion007 Skylion007 deleted the upgrade-clang-format-hook branch October 6, 2021 18:43
JuanTheEngineer pushed a commit that referenced this pull request Oct 8, 2021
* Add proper clang-format to pre-commit

* Change mirror

* Autoupdate hooks and freeze clang-format

* Try to fix cpp-lint

* Remove cpp_lint job

* Rollback from RC

* Add comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants