Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add a codecheck make target #682

Merged
merged 3 commits into from
Sep 2, 2021
Merged

Conversation

azeey
Copy link
Collaborator

@azeey azeey commented Sep 1, 2021

🎉 New feature

Summary

Follow up from #680 (comment)

Utilizes ignition-cmake's IgnCodecheck module to create a codecheck target.
Needs gazebosim/gz-cmake#186 to eliminate some false positives.

Test it

Run make codecheck

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

Utilizes ignition-cmake's IgnCodecheck module to create the codecheck
target.

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@github-actions github-actions bot added Gazebo 1️1️ Dependency of Gazebo classic version 11 🏰 citadel Ignition Citadel labels Sep 1, 2021
@azeey azeey mentioned this pull request Sep 1, 2021
8 tasks
@codecov-commenter
Copy link

codecov-commenter commented Sep 1, 2021

Codecov Report

Merging #682 (9a6d507) into sdf9 (d087d47) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             sdf9     #682   +/-   ##
=======================================
  Coverage   86.84%   86.84%           
=======================================
  Files          62       62           
  Lines        9738     9738           
=======================================
  Hits         8457     8457           
  Misses       1281     1281           
Impacted Files Coverage Δ
include/sdf/Exception.hh 100.00% <ø> (ø)
include/sdf/Param.hh 74.19% <ø> (ø)
src/Error.cc 100.00% <ø> (ø)
src/SDF.cc 92.26% <ø> (ø)
src/ign.cc 72.72% <ø> (ø)
include/sdf/Console.hh 100.00% <100.00%> (ø)

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 d087d47...9a6d507. Read the comment docs.

@adlarkin adlarkin added the needs upstream release Blocked by a release of an upstream library label Sep 1, 2021
Copy link
Contributor

@adlarkin adlarkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I tested it with gazebosim/gz-cmake#186 and had no issues. I just have one minor question.

# Find ignition cmake2
# Only for using the testing macros and creating the codecheck target, not
# really being use to configure the whole project
find_package(ignition-cmake2 2.3 REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason why version 2.3 is the minimum required version? It looks like ign_setup_target_for_codecheck exists before 2.3: https://github.com/ignitionrobotics/ign-cmake/blob/ignition-cmake2_2.2.0/cmake/IgnCodeCheck.cmake#L1-L2

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will actually need to be updated since this PR needs a new release of ign-cmake to ensure make codecheck is clean.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't add that as a version requirement, since that will cause build failures if people have an outdated version of ign-cmake, which is a bit extreme to ensure correct linting. I would recommend a find_package call with no version requirement, since IgnCodeCheck was present in ign-cmake's 2.0.0 release

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point; I think I agree with @scpeters comments.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. If it won't cause failure in CI, since we assume CI will have the latest ign-cmake, we can remove the version requirement.

Also, I originally thought gazebosim/gz-cmake#187 would be needed to make CI pass, but it turns out without that PR, we do get output from codechech, but they are just warnings, not errors. So technically, this PR can go in without the ign-cmake release.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@azeey
Copy link
Collaborator Author

azeey commented Sep 2, 2021

@osrf-jenkins run test

@azeey azeey merged commit 1d77861 into gazebosim:sdf9 Sep 2, 2021
@azeey azeey deleted the sdf9_codecheck_target branch September 2, 2021 19:06
@scpeters scpeters mentioned this pull request Nov 4, 2021
8 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
🏰 citadel Ignition Citadel Gazebo 1️1️ Dependency of Gazebo classic version 11 needs upstream release Blocked by a release of an upstream library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants