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

CI/CD: clang-format #7

Merged
merged 12 commits into from
Apr 9, 2024
Merged

CI/CD: clang-format #7

merged 12 commits into from
Apr 9, 2024

Conversation

eric15342335
Copy link
Owner

@eric15342335 eric15342335 commented Mar 27, 2024

Use Github actions and clang-format to check code formatting for every pull requests.
Question: Which code formatting style do you prefer?

Some tools: clang-format configurator
(Note: please squash merge this.)

@eric15342335 eric15342335 force-pushed the github-actions-make-clang-format branch 2 times, most recently from e19de34 to a88cdd3 Compare March 27, 2024 08:47
@eric15342335 eric15342335 self-assigned this Mar 27, 2024
Use Github actions to automatically test compile and check code formatting for every pull requests and pushes.

Signed-off-by: Cheng Ho Ming <eric310@connect.hku.hk>
@eric15342335 eric15342335 force-pushed the github-actions-make-clang-format branch from a88cdd3 to 3e1b90f Compare March 30, 2024 06:44
@eric15342335 eric15342335 added this to the Final Project Submission milestone Apr 2, 2024
Since the Makefile is not ready
@eric15342335 eric15342335 force-pushed the github-actions-make-clang-format branch 2 times, most recently from 449787d to 8d9516e Compare April 4, 2024 08:13
@eric15342335 eric15342335 changed the title CI/CD: clang-format and make CI/CD: clang-format Apr 4, 2024
@eric15342335 eric15342335 force-pushed the github-actions-make-clang-format branch from 8d9516e to d76c69b Compare April 4, 2024 08:24
@eric15342335
Copy link
Owner Author

eric15342335 commented Apr 5, 2024

You can download the .clang-format file, place it in the same directory as your code, and run
clang-format <your_code> > output.cpp to see the formatted code (if you have installed clang-format).

I think we can either do the auto formatting ourselves, or we put it into github actions and let the bot do it for pull requests.

  • I prefer the latter actually, since formatting commits are quite annoying to deal with. (Contribute # of lines, stales pull request review, etc)

@eric15342335
Copy link
Owner Author

I have written a working .yml file for github actions. It will automatically formats all the .cpp/.h files in the repository and (commit it) submit a pull request. I will create a pull request after this get merged.

Since it is causing readability problems
@eric15342335 eric15342335 force-pushed the github-actions-make-clang-format branch from c5bef40 to a84200f Compare April 6, 2024 07:58
@eric15342335 eric15342335 added the Comp: code format Related to <code> formatting, linting, NOT output formatting. Use "Table" or "UI/UX" instead. label Apr 6, 2024
Use Github actions to automatically test compile and check code formatting for every pull requests and pushes.

Signed-off-by: Cheng Ho Ming <eric310@connect.hku.hk>
Since the Makefile is not ready
Since it is causing readability problems
@eric15342335 eric15342335 force-pushed the github-actions-make-clang-format branch from 6bcbdeb to e05077c Compare April 8, 2024 13:35
Copy link
Collaborator

@MaxChungsh MaxChungsh left a comment

Choose a reason for hiding this comment

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

go

Copy link
Collaborator

@MaxChungsh MaxChungsh left a comment

Choose a reason for hiding this comment

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

approve

MaxChungsh
MaxChungsh previously approved these changes Apr 9, 2024
@eric15342335 eric15342335 merged commit b11e2c6 into main Apr 9, 2024
1 check passed
@eric15342335 eric15342335 deleted the github-actions-make-clang-format branch April 11, 2024 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Comp: code format Related to <code> formatting, linting, NOT output formatting. Use "Table" or "UI/UX" instead.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants