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

Enforce formatting #319

Open
myurkin opened this issue Mar 28, 2022 · 2 comments
Open

Enforce formatting #319

myurkin opened this issue Mar 28, 2022 · 2 comments
Assignees
Labels
DevOps Testing, deployment, automation maintainability Simplifies further code development (standardization, robustness) pri-Medium Worth assigning to a milestone
Milestone

Comments

@myurkin
Copy link
Member

myurkin commented Mar 28, 2022

We have description of the code style - https://github.com/adda-team/adda/wiki/CodeStyleGuide. But it is neither comprehensive (covers all cases) nor enforced. It would be great to implement testing for the style in Github Actions - probably some existing standard can be adopted for that. And, naturally, it should be as much close to the existing de-facto style as possible.

The first step is to study existing standards for C code, and whether they are readily available in IDEs and automatic tools.

@myurkin myurkin added pri-Medium Worth assigning to a milestone maintainability Simplifies further code development (standardization, robustness) DevOps Testing, deployment, automation labels Mar 28, 2022
@myurkin myurkin added this to the 1.6 milestone Mar 28, 2022
@myurkin
Copy link
Member Author

myurkin commented Mar 28, 2022

/cc @palatni

@Argencle
Copy link
Contributor

To address the need for an enforceable and automated code style, I propose adopting clang-format as the primary tool for this purpose.

  1. Widely Adopted: It's a well-established tool, supporting popular coding standards like LLVM and Google.
  2. Customizable: We can create a .clang-format file tailored to closely match the existing de-facto ADDA style.
  3. IDE Integration: It works seamlessly with major IDEs.
  4. Automation-Friendly:
    • Can be integrated into GitHub Actions to check for code style adherence on pull requests.
    • Supports workflows like pre-commit hooks or git clang-format for local enforcement.

I believe this will simplify enforcement, improve consistency, and reduce manual efforts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DevOps Testing, deployment, automation maintainability Simplifies further code development (standardization, robustness) pri-Medium Worth assigning to a milestone
Projects
None yet
Development

No branches or pull requests

2 participants