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

Run cpplint/cppcheck on Focal CI #880

Merged
merged 7 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
uses: ignition-tooling/action-ignition-ci@focal
with:
codecov-enabled: true
cppcheck-enabled: true
cpplint-enabled: true
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Jammy CI
Expand Down
2 changes: 1 addition & 1 deletion usd/include/sdf/usd/sdf_parser/Light.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <string>

// TODO(adlarkin):this is to remove deprecated "warnings" in usd, these warnings
// TODO(adlarkin) this is to remove deprecated "warnings" in usd, these warnings
// are reported using #pragma message so normal diagnostic flags cannot remove
// them. This workaround requires this block to be used whenever usd is
// included.
Expand Down
2 changes: 1 addition & 1 deletion usd/include/sdf/usd/sdf_parser/World.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <string>

// TODO(ahcorde):this is to remove deprecated "warnings" in usd, these warnings
// TODO(ahcorde) this is to remove deprecated "warnings" in usd, these warnings
// are reported using #pragma message so normal diagnostic flags cannot remove
// them. This workaround requires this block to be used whenever usd is
// included.
Expand Down
6 changes: 3 additions & 3 deletions usd/include/sdf/usd/usd_parser/USDData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ namespace sdf

/// \brief Initialize the data inside the class with the stage
/// defined in the constructor
/// \return Errors, which is a vector of Error objects. Each Error includes
/// \return A vector of Error objects. Each Error includes
/// an error code and message. An empty vector indicates no error.
public: UsdErrors Init();

/// \brief If a stage contains substages, this will allow to include
/// them.
/// \return Errors, which is a vector of Error objects. Each Error includes
/// \return A vector of Error objects. Each Error includes
/// an error code and message. An empty vector indicates no error.
public: UsdErrors AddStage(const std::string &_ref);

/// \brief Read materials
/// \return Errors, which is a vector of Error objects. Each Error includes
/// \return A vector of Error objects. Each Error includes
/// an error code and message. An empty vector indicates no error.
public: UsdErrors ParseMaterials();

Expand Down
2 changes: 1 addition & 1 deletion usd/include/sdf/usd/usd_parser/USDStage.hh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace sdf
public: explicit USDStage(const std::string &_refFileName);

/// \brief Initialize the data structure
/// \return Errors, which is a vector of Error objects. Each Error includes
/// \return A vector of Error objects. Each Error includes
/// an error code and message. An empty vector indicates no error.
public: UsdErrors Init();

Expand Down
6 changes: 3 additions & 3 deletions usd/src/UsdTestUtils.hh
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ void CheckInertial(const pxr::UsdPrim &_usdPrim,
EXPECT_EQ(_isRigid, _usdPrim.HasAPI<pxr::UsdPhysicsRigidBodyAPI>());
EXPECT_EQ(_isRigid, _usdPrim.HasAPI<pxr::UsdPhysicsMassAPI>());
}
} // namespace testing
} // namespace usd
} // namespace testing
} // namespace usd
}
} // namespace sdf
} // namespace sdf

#endif
5 changes: 3 additions & 2 deletions usd/src/sdf_parser/Link_Sdf2Usd_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <gtest/gtest.h>

// TODO(ahcorde):this is to remove deprecated "warnings" in usd, these warnings
// TODO(ahcorde) this is to remove deprecated "warnings" in usd, these warnings
// are reported using #pragma message so normal diagnostic flags cannot remove
// them. This workaround requires this block to be used whenever usd is
// included.
Expand Down Expand Up @@ -121,7 +121,8 @@ TEST_F(UsdStageFixture, Link)
ignition::math::Vector3d(2, 0, 2.5),
ignition::math::Quaterniond(0, 0, 0)));
std::string cylinderLinkPath = cylinderPath + "/" + "link";
auto cylinderLink = this->stage->GetPrimAtPath(pxr::SdfPath(cylinderLinkPath));
auto cylinderLink =
this->stage->GetPrimAtPath(pxr::SdfPath(cylinderLinkPath));
ASSERT_TRUE(cylinderLink);
sdf::usd::testing::CheckInertial(
cylinderLink, 1, pxr::GfVec3f(1, 1, 1), pxr::GfQuatf(1, 0, 0, 0),
Expand Down
6 changes: 4 additions & 2 deletions usd/src/sdf_parser/Sensors_Sdf2Usd_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ TEST_F(UsdStageFixture, Sensors)
lidarSensor.GetAttribute(pxr::TfToken("minRange")).Get(&minRange);
lidarSensor.GetAttribute(pxr::TfToken("maxRange")).Get(&maxRange);
lidarSensor.GetAttribute(pxr::TfToken("horizontalFov")).Get(&hFOV);
lidarSensor.GetAttribute(pxr::TfToken("horizontalResolution")).Get(&hResolution);
lidarSensor.GetAttribute(
pxr::TfToken("horizontalResolution")).Get(&hResolution);
lidarSensor.GetAttribute(pxr::TfToken("verticalFov")).Get(&vFOV);
lidarSensor.GetAttribute(pxr::TfToken("verticalResolution")).Get(&vResolution);
lidarSensor.GetAttribute(
pxr::TfToken("verticalResolution")).Get(&vResolution);
EXPECT_FLOAT_EQ(10.0f, maxRange);
EXPECT_FLOAT_EQ(0.08f, minRange);
EXPECT_FLOAT_EQ(159.99995f, hFOV);
Expand Down
2 changes: 1 addition & 1 deletion usd/src/sdf_parser/World_Sdf2Usd_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include <gtest/gtest.h>

// TODO(ahcorde):this is to remove deprecated "warnings" in usd, these warnings
// TODO(ahcorde) this is to remove deprecated "warnings" in usd, these warnings
// are reported using #pragma message so normal diagnostic flags cannot remove
// them. This workaround requires this block to be used whenever usd is
// included.
Expand Down
2 changes: 1 addition & 1 deletion usd/src/usd_parser/USD2SDF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ UsdErrors USD2SDF::Read(const std::string &_fileName,
const auto addWorldErrors = _root.AddWorld(sdfWorld);
if (!addWorldErrors.empty())
{
for (const auto & error: addWorldErrors)
for (const auto & error : addWorldErrors)
{
errors.emplace_back(error);
}
Expand Down
2 changes: 1 addition & 1 deletion usd/src/usd_parser/USDData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ namespace usd {
}
}
}
return std::make_pair<std::string, std::shared_ptr<USDStage>>("", nullptr);
return std::make_pair("", nullptr);
}

/////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions usd/src/usd_parser/USDMaterial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*
*/

#include <string>
#include "USDMaterial.hh"

#include <ignition/common/Filesystem.hh>
Expand Down
2 changes: 1 addition & 1 deletion usd/src/usd_parser/USDStage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <set>
#include <string>

// TODO(ahcorde):this is to remove deprecated "warnings" in usd, these warnings
// TODO(ahcorde) this is to remove deprecated "warnings" in usd, these warnings
// are reported using #pragma message so normal diagnostic flags cannot remove
// them. This workaround requires this block to be used whenever usd is
// included.
Expand Down
2 changes: 2 additions & 0 deletions usd/src/usd_parser/USDWorld.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
*/
#include "USDWorld.hh"

#include <memory>
#include <string>
#include <utility>

#pragma push_macro ("__DEPRECATED")
#undef __DEPRECATED
Expand Down