charlesvdv / boulot-robot

GNU General Public License v3.0
0 stars 2 forks source link

Add clang-format support #37

Closed JonathanPetit closed 4 years ago

JonathanPetit commented 4 years ago

clang-format

This PR add clang-format support:

.cmake folder

I decided to create a .cmake folder. This folder have a check-format.cmake file to deal with clang-format. We have one command to check the format and an other to apply clang-format settings in all files (except build/) into the repository. This is the only way i have found to check all files into the repository (source and source). We can do otherwise if you have an other idea.

clang-format settings

I based this config .clang-format on our conventions. Some changes:

I apply this settings on pathfinding/src/ folder for example, so go take a look! After our validations and changes, i apply settings on all repo.

codecov-commenter commented 4 years ago

Codecov Report

Merging #37 into master will increase coverage by 0.36%. The diff coverage is 74.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #37      +/-   ##
==========================================
+ Coverage   79.35%   79.72%   +0.36%     
==========================================
  Files          34       34              
  Lines         591      582       -9     
  Branches      317      312       -5     
==========================================
- Hits          469      464       -5     
+ Misses        122      118       -4     
Impacted Files Coverage Δ
path-planning/include/path-planning/map.hpp 100.00% <ø> (ø)
path-planning/include/path-planning/obstacle.hpp 100.00% <ø> (ø)
path-planning/src/map_impl.hpp 100.00% <ø> (ø)
path-planning/src/obstacle_circle.hpp 100.00% <ø> (ø)
path-planning/src/obstacle_rectangle.hpp 100.00% <ø> (ø)
path-planning/tests/test_obstacle_circle.cpp 100.00% <ø> (ø)
robotlib/tests/test-proximity-detection.cpp 100.00% <ø> (ø)
visualization/bin/svg-example.cpp 0.00% <0.00%> (ø)
visualization/include/visualization/renderer.hpp 0.00% <ø> (ø)
visualization/src/circle.cpp 0.00% <0.00%> (ø)
... and 21 more

Continue to review full report at Codecov.

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

JonathanPetit commented 4 years ago

So i tried to fix the github actions... Without success... I need clang-format-10 but i think it not available on github actions ubuntu-latest. I tried this but it break our build. So, you have an idea @charlesvdv ?

charlesvdv commented 4 years ago

Why is the v10 a strong requirement? I will check a bit if I can make it work :smile:

JonathanPetit commented 4 years ago

Because it introduce some new settings like AllowShortIfStatementsOnASingleLine: Never. It's only true or false in the older versions.

charlesvdv commented 4 years ago

Well, are those really necessary? Can we go with false instead of Never?

JonathanPetit commented 4 years ago

Yes, we can. But between v9 and v10, i have 6 unknown key and 3 Invalid arguments. I can test a config in v9 (github actions works with v9), but the config will be less strong. I do this ?

charlesvdv commented 4 years ago

Let's try it at least ;)

JonathanPetit commented 4 years ago

It works fine with v9 also! :+1:

JonathanPetit commented 4 years ago

Ok it works fine for everythings! You can review a new time or merge :wink: