Skip to content

Add pre-commit Hook to reject commits that fail the clang-format check!#534

Open
Ohisemega wants to merge 3 commits into
masterfrom
add_clang_formatting_to_githook
Open

Add pre-commit Hook to reject commits that fail the clang-format check!#534
Ohisemega wants to merge 3 commits into
masterfrom
add_clang_formatting_to_githook

Conversation

@Ohisemega

Copy link
Copy Markdown
Contributor

Add 'postStartCommand' to copy the pre-commit script to ./git/hooks directory at container startup.

Fixes #533

@Ohisemega
Ohisemega requested review from JamesOHeaDLS and ajgdls July 10, 2026 11:18
@Ohisemega Ohisemega self-assigned this Jul 10, 2026
@Ohisemega Ohisemega added enhancement Next stage development or improvement of an existing feature or utility. nice-to-have Good feature/modification, but it doesn't impact the current state of the project's development. docs/tooling Documentation/development/deployment tools which improve the developers' and users' experience CI/CD Issues related to the CI/CD pipeline and toolings in odin-data labels Jul 10, 2026
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.46%. Comparing base (9a92832) to head (545b3b2).
⚠️ Report is 20 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #534       +/-   ##
===========================================
+ Coverage   33.66%   47.46%   +13.80%     
===========================================
  Files          95       95               
  Lines        7690     7685        -5     
  Branches      672      672               
===========================================
+ Hits         2589     3648     +1059     
+ Misses       4907     3843     -1064     
  Partials      194      194               

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JamesOHeaDLS

JamesOHeaDLS commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Andrew Duller created a script to ensure Git hooks were setup correctly. It is mentioned in README.git-hooks but it is not obvious to new developers that this should be read before working with the repo.

I propose that instead of adding to postStartCommand we update the main README with instructions for initial developer setup

cc: @Ohisemega @ajgdls

@Ohisemega
Ohisemega force-pushed the add_clang_formatting_to_githook branch from 2de94b0 to 434ba9e Compare July 14, 2026 11:37
@Ohisemega

Ohisemega commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Andrew Duller created a script to ensure Git hooks were setup correctly. It is mentioned in README.git-hooks but it is not obvious to new developers that this should be read before working with the repo.

I propose that instead of adding to postStartCommand we update the main README with instructions for initial developer setup

cc: @Ohisemega @ajgdls

I have added the script Andy wrote as a postCreateCommand to set up the githook infrastructure during container build. I also updated the README file.

@Ohisemega

Copy link
Copy Markdown
Contributor Author

Hi @JamesOHeaDLS, could this PR please be reviewed for approval once more? Given it's a minor tooling improvement.
cc: @ajgdls

Comment thread README.md Outdated
Comment thread README.md Outdated
@Ohisemega
Ohisemega requested a review from ajgdls July 16, 2026 11:17
@Ohisemega
Ohisemega requested a review from timcnicholls July 17, 2026 13:06

@JamesOHeaDLS JamesOHeaDLS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @Ohisemega I can confirm that the config gets set on rebuild of the devcontainer

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

Labels

CI/CD Issues related to the CI/CD pipeline and toolings in odin-data docs/tooling Documentation/development/deployment tools which improve the developers' and users' experience enhancement Next stage development or improvement of an existing feature or utility. nice-to-have Good feature/modification, but it doesn't impact the current state of the project's development.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Clang Formatting Script as a Git Commit Hook

3 participants