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 Housekeeping to Check Code Style with clang-format #1674

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ahnaf-tahmid-chowdhury
Copy link
Contributor

Description

This PR adds a new GitHub Actions workflow named "Housekeeping Checks". The workflow is triggered on workflow_dispatch (manual runs) and pull_request events targeting the develop branch.

Changes Made

  • Added a new workflow file named housekeeping.yml to the .github/workflows directory.
  • The workflow runs on ubuntu-latest and consists of the following steps:
    • Checkout the repository
    • Install clang-format dependencies
    • Setup environment variables
    • Execute the housekeeping script that runs clang-format on the source files and checks for style guide violations. If any are found, the script will fail, and the PR will not be merged.

Related Issue

This PR addresses issue #1669.

Additional Notes

  • The housekeeping script uses git status --porcelain to check for changes in the working directory after running clang-format.
  • If any changes are found, the script will print the differences and fail the workflow with an error message.
  • This workflow helps maintain code style consistency and ensures that all changes adhere to the project's coding standards.

@ahnaf-tahmid-chowdhury
Copy link
Contributor Author

Here is my Workflow

@ahnaf-tahmid-chowdhury
Copy link
Contributor Author

I'm having trouble with housekeeping. Is it advisable to execute clang-format and create a new commit with the already available .clang-format file?

@gonuke
Copy link
Member

gonuke commented Feb 19, 2024

We (esp. @dean-krueger )have discovered that this is currently dangerous b/c of some features of Cyclus and may need more careful consideration.

@ahnaf-tahmid-chowdhury
Copy link
Contributor Author

ahnaf-tahmid-chowdhury commented Feb 19, 2024

Yes. I have noticed the coverage is 33%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Status: On Deck
Development

Successfully merging this pull request may close these issues.

None yet

3 participants