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

✨ Make ClangFormat aware of different line ending types and enforce LF #177

Merged
merged 4 commits into from
Apr 25, 2023

Conversation

marcelwa
Copy link
Collaborator

@marcelwa marcelwa commented Apr 6, 2023

Description

This PR extends the ClangFormat configuration to standardize all line endings to use LF. It also reformats the project using ClangFormat 16.

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

@marcelwa marcelwa added the enhancement New feature or request label Apr 6, 2023
@marcelwa marcelwa self-assigned this Apr 6, 2023
@codecov
Copy link

codecov bot commented Apr 6, 2023

Codecov Report

Merging #177 (2928aae) into main (a64bdc7) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #177   +/-   ##
=======================================
  Coverage   94.28%   94.28%           
=======================================
  Files          79       79           
  Lines        7196     7196           
=======================================
  Hits         6785     6785           
  Misses        411      411           
Impacted Files Coverage Δ
include/fiction/io/read_fqca_layout.hpp 98.68% <ø> (ø)
include/fiction/algorithms/path_finding/a_star.hpp 97.53% <100.00%> (ø)
...tion/algorithms/path_finding/jump_point_search.hpp 98.42% <100.00%> (ø)
.../algorithms/physical_design/one_pass_synthesis.hpp 88.19% <100.00%> (ø)
include/fiction/io/write_qll_layout.hpp 97.61% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 983fcd3...2928aae. Read the comment docs.

@marcelwa
Copy link
Collaborator Author

marcelwa commented Apr 6, 2023

Several things here:

  1. clang-format-lint-action only supports ClangFormat versions up to 15. I have added a version 16 feature: LineEnding: LF. It makes it crash... Furthermore, the action does not allow us to specify the execution parameter --Wno-error=unknown, which would prevent it from crashing. But that's not the only problem brought to attention by this behavior.
  2. Later versions of ClangFormat, e.g. 16, seem to format consecutive comments differently than version 15. This can lead to an inconsistency between our local formatter and the one in the GitHub Action.

Ideally, we find a way to use ClangFormat 16 in the CI.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

clang-tidy review says "All clean, LGTM! 👍"

@marcelwa marcelwa added the github_actions Pull requests that update GitHub Actions code label Apr 25, 2023
@marcelwa
Copy link
Collaborator Author

marcelwa commented Apr 25, 2023

After raising an issue in the respective repo, there is now support for ClangFormat 16, which we are using now. Hope everything checks out 🤞

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@marcelwa marcelwa merged commit d01b994 into main Apr 25, 2023
@marcelwa marcelwa deleted the clang-format-line-endings branch April 25, 2023 10:49
Drewniok added a commit that referenced this pull request May 7, 2023
* ✨ header for temperature simulation

* ✨ header for temperature simulation

* ✅ occupation function with tests

* 🚧 "critical temperature function" is implemented. Test also added.

* 🚧 CT of "bestagon gates" can be simulated correctly

* ✅ tests updated

* ✅ tests updated

* ✅ tests updated

* 🎨 map replaced by vector

* 📝 docu for new functions

* 📝 docu for new functions

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🚀

* ⬆️ submodules upgraded

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 small cahnges

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 replaced std::rand(), caused problem at temperature implementation

* 🎨 small changes here and there

* 🎨 reformat code

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 renaming function

* ✨ flag added to decide between gate and random layout

* ✨ flag added to decide between gate and random layout

* ✨ flag added to decide between gate and random layout

* ✨ min_energy added in occupation_probability.hpp

* 🎨 Reformatted and cleaned up code

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 Slight revision for consistency

* 🎨 renaming

* ⬆️ Bump libs/Catch2 from `50bf00e` to `9a2a4ea` (#182)

* 🎨 reformat code

* redefinition of sidb_nm_position (#186)

* ⬆️ Bump libs/Catch2 from `6783411` to `1f881ab` (#27)

Bumps [libs/Catch2](https://github.com/catchorg/Catch2) from `6783411` to `1f881ab`.
- [Release notes](https://github.com/catchorg/Catch2/releases)
- [Commits](catchorg/Catch2@6783411...1f881ab)

---
updated-dependencies:
- dependency-name: libs/Catch2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️ Bump libs/parallel-hashmap from `7883cb6` to `d2bed96` (#33)

Bumps [libs/parallel-hashmap](https://github.com/greg7mdp/parallel-hashmap) from `7883cb6` to `d2bed96`.
- [Release notes](https://github.com/greg7mdp/parallel-hashmap/releases)
- [Commits](greg7mdp/parallel-hashmap@7883cb6...d2bed96)

---
updated-dependencies:
- dependency-name: libs/parallel-hashmap
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 🎨 return value of ``sidb_nm_position`` changed from meter to nanometer for consistency.

* 🎨 renaming.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Drewniok <[email protected]>

* 👷 Use the GitHub token of the checked-out repo instead of the own for the `add-and-commit` action after clang-format has been run

* 🎨 Changed the unit of the lambda-tf physical parameter from meter to nanometer (#188)

* 🎨 Unit of `lambda_tf` is changed from meter to nanometer.

* 🎨 `epsilon_r` is unit-less.

* ✨ Added a function to round a number to `n` decimal places (#189)

* ✨ small function to round numbers to ``n`` decimal places.

* ✅ test added.

* 🎨 implemented Marcel's suggestions.

* 🎨 make use of new function in ``energy_distribution``.

* ✨ Added an SiDB simulation file writer (#176)

* ✨ Added a new unified return type for SiDB simulation

* ✨ Added a file writer for SQD simulation runs parsable by SiQAD

* 📝 Added and fixed docstrings

* 📝 Added RST documentation

* 📝 Removed superfluous newlines

* 🎨 Incorporated clang-tidy's recommendations

* 🎨 Rewrote `any_to_string` to be more performant and extensible

* 🐛 Replaced the usage of the custom charge to string function with the one provided by `sidb_charge_state.hpp`

* ✅ Added a test case for positive SiDBs

* ✅ Added test cases for `any_to_string`

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🐛 Added `inline` to `any_to_string` in order to avoid ODR problems

* ✅ Fixed the test case

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 👽 Convert nm to Angstrom

* 👽 Round distances and energy values to 6 decimal points

* ✅ Added additional tests to cover more lines

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

---------

Signed-off-by: ClangFormat <[email protected]>
Co-authored-by: ClangFormat <[email protected]>

* 🎨 larger architectural changes.

* 🎨 reformat code and documentation.

* 🎨 small changes in exhaustive_ground_state_simulation.hpp due to unit changes from ``main`` branch.

* 📝 added docu.

* ⬆️ Bump ZedThree/clang-tidy-review from 0.12.2 to 0.13.0 (#193)

* ⬆️ Bump libs/Catch2 from `9a2a4ea` to `10596b2` (#191)

Bumps [libs/Catch2](https://github.com/catchorg/Catch2) from `9a2a4ea` to `10596b2`.
- [Release notes](https://github.com/catchorg/Catch2/releases)
- [Commits](catchorg/Catch2@9a2a4ea...10596b2)

---
updated-dependencies:
- dependency-name: libs/Catch2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ⬆️ Bump libs/parallel-hashmap from `d2bed96` to `7807157` (#192)

Bumps [libs/parallel-hashmap](https://github.com/greg7mdp/parallel-hashmap) from `d2bed96` to `7807157`.
- [Release notes](https://github.com/greg7mdp/parallel-hashmap/releases)
- [Commits](greg7mdp/parallel-hashmap@d2bed96...7807157)

---
updated-dependencies:
- dependency-name: libs/parallel-hashmap
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ✅ Ensured a reproducible SiDB order for test reproducibility (#194)

* ✅ Ensured a reproducible SiDB order for test reproducibility

* 💚 Ordered surfaces as well

---------

Co-authored-by: Jan Drewniok <[email protected]>

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* ⬆️ Bump DoozyX/clang-format-lint-action from 0.15 to 0.16 (#196)

Bumps [DoozyX/clang-format-lint-action](https://github.com/DoozyX/clang-format-lint-action) from 0.15 to 0.16.
- [Release notes](https://github.com/DoozyX/clang-format-lint-action/releases)
- [Commits](DoozyX/clang-format-lint-action@v0.15...v0.16)

---
updated-dependencies:
- dependency-name: DoozyX/clang-format-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 🎨 changes after review.

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 changes after review.

* 🎨 use data type for energy distribution.

* 🎨 additional ``else`` to try to fix windows build issue.

* ✨ Make ClangFormat aware of different line ending types and enforce `LF` (#177)

* 🎨 Added a flag to the ClangFormat config to enforce LF line endings (as of version 16)

* 🎨 Re-applied ClangFormat to the project

* ⬆️ Switched to ClangFormat 16

* 📝 add links for RST.

* 📝 add links for RST.

* 📝 add named anchor.

* 📝 use ``-`` instead of ``_``.

* 🐛 add missing ``$`` in docstring.

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 copy enum class to try to solve window build issue.

* 🎨 tiny change in docu.

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🔥 remove file from git.

* ✅ add additional test.

* 🐛 add ``recompute_energy`` and test which failed before.

* 🎨 change to scoped enumerator.

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 use enum struct.

* 🔥 remove ``enum class``due to windows CI issue.

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 replace reference.

* ✨ code to generate unique random layouts.

* ✨ Temperature-aware simulation can be conducted with ``exgs`` or ``quicksim``. All simulation engines use ``sidb_simulation_result`` now to collect results.

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 rename struct member.

* 🎨 activate automatic state count detection.

* ⬆️ Bump libs/parallel-hashmap from `7807157` to `9f09034` (#199)

* 🎨 Ensured SiQAD compatibility of SiDB simulation result writer (#197)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 🎨 fix ``state count`` to three. Two is not supported by SiQAD yet.

* 🎨 reformat code.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Marcel Walter <[email protected]>

* 🎨 update after review (main change: replace stats_pointer as input for simulators).

* 🎨 ClangFormat changes

Signed-off-by: ClangFormat <[email protected]>

* 🎨 introduce impl_class for quickexact.

* 🎨 remove ``const``keyword.

* 🎨 add ``const``keyword.

* 🎨 split in several smaller functions.

* 🎨 rename some functions.

* 📝 add docu.

* ✨ automatic base number detection can be turned ``on`` and ``off``.

* 📝 add more documentation.

* 🔥 remove files to shift it to separate PR.

* 🎨 change order of ``const``keyword and type.

* 📝 add RST.

* 📝 add documentation.

* 💚 add ``const`` keyword.

* 🎨 smaller changes to try to fix test issue.

* ✅ small change to avoid windows issue.

* 📝 add documentation.

---------

Signed-off-by: ClangFormat <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Drewniok <[email protected]>
Co-authored-by: ClangFormat <[email protected]>
Co-authored-by: Marcel Walter <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request github_actions Pull requests that update GitHub Actions code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant