Skip to content

Clarify style guidelines in the online documentation and set up clang-format #150

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

Open
superwhiskers opened this issue Jun 3, 2024 · 7 comments · May be fixed by #151
Open

Clarify style guidelines in the online documentation and set up clang-format #150

superwhiskers opened this issue Jun 3, 2024 · 7 comments · May be fixed by #151
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested

Comments

@superwhiskers
Copy link
Collaborator

related to #54 / #82, albeit it deserves a dedicated pull request to unbundle it from the addition of pre-commit

rationale

currently, CONTRIBUTING.md is insufficiently precise in some ways and the repository's existing .clang-format file is not used and does not match the conventions within CONTRIBUTING.md exactly. clarifying the style guidelines and setting up .clang-format would help maintain a consistent style across the codebase and potentially make it more welcoming to newcomers

considerations

  • how is existing code formatted in relation to what is documented in CONTRIBUTING.md?
  • how should the codified style be imposed upon existing code?
    • should we incrementally reformat code when it is touched, or should we reformat it all in one go?
  • should we add a precommit hook?
  • what additional linting tools should we use and how/when should they be applied?

initial suggestions

  • drop Add pre-commit configuration + GitHub Actions #54 & Precommit addition to the repo #82 for now
  • open a new pull request deleting the existing .clang-format file in .github/workflows1 since it isn't used and remove the dead code within the root CMakeLists.txt2 that references it
  • create a new .clang-format at the repository's root which takes into account existing style conventions + the stuff within CONTRIBUTING.md, with a priority toward the latter, updating CONTRIBUTING.md accordingly
  • do not apply the styling to existing code until a solution is agreed upon

Footnotes

  1. https://github.com/ORNL/ReSolve/blob/develop/.github/workflows/.clang-format

  2. https://github.com/ORNL/ReSolve/blob/d913854aed438af040f6ecd5bee052da3a861baa/CMakeLists.txt#L56-L58

@superwhiskers superwhiskers added the enhancement New feature or request label Jun 3, 2024
@superwhiskers superwhiskers self-assigned this Jun 3, 2024
superwhiskers added a commit that referenced this issue Jun 3, 2024
- drop dead code within `CMakeLists.txt`
- remove old `.github/workflows/.clang-format`
- create new `.clang-format` at the repository root, with settings based on observed patterns & `CONTRIBUTING.md`
@superwhiskers superwhiskers linked a pull request Jun 3, 2024 that will close this issue
@superwhiskers superwhiskers added documentation Improvements or additions to documentation question Further information is requested labels Jun 3, 2024
@superwhiskers superwhiskers linked a pull request Jun 3, 2024 that will close this issue
@superwhiskers superwhiskers removed a link to a pull request Jun 3, 2024
@superwhiskers
Copy link
Collaborator Author

some additional comments:

@pelesh
Copy link
Collaborator

pelesh commented Jun 4, 2024

@cameronrutherford and @ryandanehy, please chime in.

CC: @kswirydo

@cameronrutherford
Copy link
Collaborator

Closed #82. I think we could close #54 without doing C++ formatting, and then have the clang-format and clang-tidy hooks added in another PR/Issue.

+1 to the clang-tidy suggestion. Might be worth discussion in another issue and closing out one thing at a time.

@pelesh
Copy link
Collaborator

pelesh commented Sep 20, 2024

  • open a new pull request deleting the existing .clang-format file in .github/workflows1 since it isn't used and remove the dead code within the root CMakeLists.txt2 that references it
  • create a new .clang-format at the repository's root which takes into account existing style conventions + the stuff within CONTRIBUTING.md, with a priority toward the latter, updating CONTRIBUTING.md accordingly

I think @superwhiskers makes a good point. We can use #151 to test locally the .clang_format file and update instructions in CONTRIBUTING.md as needed. I suggest we mere #151 once we agree upon code style standards for Re::Solve. Then we reopen #82 and set pre-commit hooks and perhaps other actions as needed.

@pelesh pelesh added this to the Release 0.99.2 milestone Feb 5, 2025
@shakedregev
Copy link
Collaborator

@pelesh Addressed here

@superwhiskers
Copy link
Collaborator Author

that appears to cover a portion of it but it lacks a clang-format configuration. additionally it creates a separate contributing guideline document in addition to CONTRIBUTING.md (without updating the latter). probably #242 should decide whether to merge the contents of its new contributing guideline document into CONTRIBUTING.md or to replace it, and if it were to completely cover the suggestions in this issue, should also contain a clang-format configuration implementing its prescriptions

pelesh pushed a commit that referenced this issue Mar 4, 2025
- drop dead code within `CMakeLists.txt`
- remove old `.github/workflows/.clang-format`
- create new `.clang-format` at the repository root, with settings based on observed patterns & `CONTRIBUTING.md`
@pelesh
Copy link
Collaborator

pelesh commented Mar 4, 2025

that appears to cover a portion of it but it lacks a clang-format configuration. additionally it creates a separate contributing guideline document in addition to CONTRIBUTING.md (without updating the latter). probably #242 should decide whether to merge the contents of its new contributing guideline document into CONTRIBUTING.md or to replace it, and if it were to completely cover the suggestions in this issue, should also contain a clang-format configuration implementing its prescriptions

Yes, I think it would be good to coordinate spelling out style guidelines and configuring clang-format. We are getting closer to merge #151.

I suggest we add pre-commit configuration with GitHub actions there, as suggested in #54.

I suggest we keep the file CONTRIBUTING.md with the link to the developer documentation and few other details.

@pelesh pelesh changed the title clarify style guidelines in CONTRIBUTING.md / set up clang-format clarify style guidelines in online documentation / set up clang-format May 12, 2025
@pelesh pelesh changed the title clarify style guidelines in online documentation / set up clang-format Clarify style guidelines in the online documentation and set up clang-format May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants