Skip to content

Add a dockerfile to make pretty#7324

Closed
Growl1234 wants to merge 14 commits intodeepmodeling:developfrom
Growl1234:develop
Closed

Add a dockerfile to make pretty#7324
Growl1234 wants to merge 14 commits intodeepmodeling:developfrom
Growl1234:develop

Conversation

@Growl1234
Copy link
Copy Markdown

@Growl1234 Growl1234 commented May 8, 2026

This is a first try to take on code checking and prettifying that is temporily dropped in the GitHub Actions workflow.

This dockerfile uses tools same as what GitHub Precommit workflow uses, and execute clang-tidy --fix and clang-format to make-pretty the C++ codes.

If this approach can be successful, here are what to do:

  1. Re-enable Precommit workflow in a seperate yaml file (split from Tests).
  2. Run clang-tidy in parallel.

An ideal long-term solution would be to take inspiration from CP2K’s approach and implement a complete and reliable pre-commit workflow.

Use tools what GitHub Precommit workflow uses
@QuantumMisaka
Copy link
Copy Markdown
Collaborator

@Growl1234 Why there are so many pyabacus changes ?

@Growl1234
Copy link
Copy Markdown
Author

@Growl1234 Why there are so many pyabacus changes ?

This is an automatic workflow and the PR is currently just a draft. The problems introduced here would all be fixed before this PR is marked as ready.

@Growl1234
Copy link
Copy Markdown
Author

Growl1234 commented May 8, 2026

And it seems at least those settings in .clang-format are incorrect and would cause a lot of errors:

IncludeBlocks: Regroup
SortIncludes: true

@Growl1234 Growl1234 force-pushed the develop branch 2 times, most recently from 3a1e99b to 8bdd60f Compare May 8, 2026 11:37
@Growl1234 Growl1234 force-pushed the develop branch 2 times, most recently from 91183dc to d0e4601 Compare May 8, 2026 12:41
@Growl1234 Growl1234 force-pushed the develop branch 3 times, most recently from c120da8 to 497f4ac Compare May 8, 2026 13:28
@Growl1234
Copy link
Copy Markdown
Author

Growl1234 commented May 8, 2026

It seems the precommit workflow would check on code outside abacus and give error about them (such as OpenMPI).

Although there might be ways to solve the problem, I do not think the current approach is reliable enough for ABACUS. We should stop directly relying on the generic pre-commit/action clang-tidy workflow and instead switch to a project-controlled DIY workflow, i.e. the “ideal long-term solution” mentioned above. This would allow us to explicitly restrict both the checked files and the fix-it scope to ABACUS source files.

@Growl1234
Copy link
Copy Markdown
Author

We should stop directly relying on the generic pre-commit/action clang-tidy workflow and instead switch to a project-controlled DIY workflow, i.e. the “ideal long-term solution” mentioned above. This would allow us to explicitly restrict both the checked files and the fix-it scope to ABACUS source files.

Closing this PR based on the thought above.

@Growl1234 Growl1234 closed this May 9, 2026
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.

2 participants