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

chore: Add pre-commit config file #2763

Merged
merged 3 commits into from
Dec 6, 2023

Conversation

paulgessinger
Copy link
Member

@paulgessinger paulgessinger commented Dec 4, 2023

pre-commit is a framework for managing git-supported pre-commit hooks. It uses a plugin system and auto-installs plugins when run. By default, this does nothing for developers, but if you install pre-commit and run

$ pre-commit install

it will register itself as a pre-commit hook with git. It will then yell at you before committing if files are not formatted correctly (I'm also adding a few other things like and end-of-file checker). It only runs on files that are staged, so it should be fast.

One neat thing is that it can run clang-format, and that it installs the correct version of clang-format from PIP! So theoretically, with this, you should get portable automatically correctly formatted commits.

[pre-commit](https://pre-commit.com/) is a framework for managing
git-supported pre-commit hooks. It uses a plugin system and
auto-installs plugins when run. By default, this does nothing for
developers, but if you install pre-commit and run

```console
$ pre-commit install
```

it will register itself as a pre-commit hook with git. It will then yell
at you before committing if files are not formatted correctly (I'm also
adding a few other things like and end-of-file checker). It only runs on
files that are staged, so it should be fast.

One neat thing is that it can run clang-format, and that it installs the
correct version of clang-tidy from PIP! So theoretically, with this, you
should get portable automatically correctly formatted commits.
@paulgessinger paulgessinger added this to the next milestone Dec 4, 2023
@AJPfleger
Copy link
Contributor

Looks interesting. So this basically can run the simple git-checks locally?

For some things like the EOF we use for the online workflow our own version. Do we need to unify them to avoid annoying discrepancies?

@paulgessinger
Copy link
Member Author

@AJPfleger I think they're already aligned. You're not forced to use this, and in my testing they don't conflict. We can adjust if that becomes a problem.

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fcbab62) 49.48% compared to head (0cd2580) 49.51%.
Report is 1 commits behind head on main.

❗ Current head 0cd2580 differs from pull request most recent head a52f984. Consider uploading reports for the commit a52f984 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2763      +/-   ##
==========================================
+ Coverage   49.48%   49.51%   +0.02%     
==========================================
  Files         474      474              
  Lines       27075    27064      -11     
  Branches    12516    12507       -9     
==========================================
+ Hits        13399    13401       +2     
+ Misses       4762     4761       -1     
+ Partials     8914     8902      -12     

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

@paulgessinger paulgessinger added ready Ready to merge, but not being merged yet and removed automerge labels Dec 5, 2023
@andiwand andiwand added automerge and removed ready Ready to merge, but not being merged yet labels Dec 5, 2023
@paulgessinger paulgessinger merged commit a8a0576 into acts-project:main Dec 6, 2023
51 checks passed
@paulgessinger paulgessinger deleted the pre-commit-config branch December 6, 2023 21:31
@github-actions github-actions bot removed the automerge label Dec 6, 2023
@acts-project-service
Copy link
Collaborator

acts-project-service commented Dec 6, 2023

✅ Athena integration test results

✅ All tests successful

status job
🟢 run_unit_tests
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsBenchmarkWithSpot.sh 8 100
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsWorkflow.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateAmbiguityResolution.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateResolvedTracks.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateTracks.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateActsCoreSpacePoints.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateActsSpacePoints.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateSeeds.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateOrthogonalSeeds.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsValidateClusters.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsPersistifyEDM.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsGSFRefitting.sh
🟢 run_ci_tests: ../athena/AtlasTest/CITest/test/ActsKfRefitting.sh
🟢 run_ci_tests: python3 ../athena/Tracking/Acts/ActsGeometry/test/ActsExtrapolationAlgTest.py
🟢 run_ci_tests: python3 ../athena/Tracking/Acts/ActsGeometry/test/ActsITkTest.py
🟢 run_workflow_tests_run4_mc
🟢 run_workflow_tests_run2_data
🟢 run_workflow_tests_run3_mc
🟢 run_workflow_tests_run3_data
🟢 run_art_test: test_data18_13TeV_1000evt
🟢 run_art_test: test_ttbarPU40_reco

@paulgessinger paulgessinger modified the milestones: next, v31.2.0 Dec 7, 2023
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.

5 participants