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

chore(ci): fix cpplint errors from pre-commit ci #15

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

mitsudome-r
Copy link
Member

@mitsudome-r mitsudome-r commented Jul 1, 2024

Description

This PR fixes errors from cpplint in pre-commit ci.
When #4 was merged, // NOLINTNEXTLINE was used to suppress errors.

However, cpplint in version 1.6.1 does not recognize cppcoreguidelines-pro-bounds-pointer-arithmetic as a supported category and outputs the following error when you run pre-commit run -a

cpplint..................................................................Failed
- hook id: cpplint
- exit code: 1

autoware_lanelet2_extension_python/src/utility.cpp:70:  Unknown NOLINT error category: cppcoreguidelines-pro-bounds-pointer-arithmetic  [readability/nolint] [5]
autoware_lanelet2_extension_python/src/utility.cpp:86:  Unknown NOLINT error category: cppcoreguidelines-pro-bounds-pointer-arithmetic  [readability/nolint] [5]
autoware_lanelet2_extension_python/src/utility.cpp:103:  Unknown NOLINT error category: cppcoreguidelines-pro-bounds-pointer-arithmetic  [readability/nolint] [5]
autoware_lanelet2_extension_python/src/utility.cpp:120:  Unknown NOLINT error category: cppcoreguidelines-pro-bounds-pointer-arithmetic  [readability/nolint] [5]
autoware_lanelet2_extension_python/src/utility.cpp:142:  Unknown NOLINT error category: cppcoreguidelines-pro-bounds-pointer-arithmetic  [readability/nolint] [5]
autoware_lanelet2_extension_python/src/utility.cpp:159:  Unknown NOLINT error category: cppcoreguidelines-pro-bounds-pointer-arithmetic  [readability/nolint] [5]
autoware_lanelet2_extension_python/src/utility.cpp:243:  Unknown NOLINT error category: cppcoreguidelines-pro-bounds-pointer-arithmetic  [readability/nolint] [5]
autoware_lanelet2_extension_python/src/utility.cpp:261:  Unknown NOLINT error category: cppcoreguidelines-pro-bounds-pointer-arithmetic  [readability/nolint] [5]
autoware_lanelet2_extension_python/src/utility.cpp:279:  Unknown NOLINT error category: cppcoreguidelines-pro-bounds-pointer-arithmetic  [readability/nolint] [5]
autoware_lanelet2_extension_python/src/utility.cpp:296:  Unknown NOLINT error category: cppcoreguidelines-pro-bounds-pointer-arithmetic  [readability/nolint] [5]
autoware_lanelet2_extension_python/src/utility.cpp:319:  Unknown NOLINT error category: cppcoreguidelines-pro-bounds-pointer-arithmetic  [readability/nolint] [5]
autoware_lanelet2_extension_python/src/utility.cpp:341:  Unknown NOLINT error category: cppcoreguidelines-pro-bounds-pointer-arithmetic  [readability/nolint] [5]
autoware_lanelet2_extension_python/src/utility.cpp:360:  Unknown NOLINT error category: cppcoreguidelines-pro-bounds-pointer-arithmetic  [readability/nolint] [5]
Done processing autoware_lanelet2_extension_python/src/utility.cpp
Total errors found: 13

We can instead use NOLINTBEGIN to generally ignore the lint for relevant lines.

Tests performed

Not applicable.

Effects on system behavior

Not applicable.

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

@mitsudome-r
Copy link
Member Author

An alternative way is to reconfigure cpplint to remove the check for cppcoreguidelines-pro-bounds-pointer-arithmetic and rely on clang-tidy.

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (3a8bde9) to head (b503a08).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #15       +/-   ##
==========================================
- Coverage   15.93%   0.00%   -15.94%     
==========================================
  Files          40      40               
  Lines        2748    2737       -11     
  Branches     1339     463      -876     
==========================================
- Hits          438       0      -438     
- Misses       2222    2737      +515     
+ Partials       88       0       -88     
Flag Coverage Δ
differential 0.00% <ø> (-15.94%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HansRobo
Copy link
Member

HansRobo commented Jul 1, 2024

@mitsudome-r You can use NOLINTBEGIN with newer version of cpplint like ibis-ssl/crane#442
Google has already ended support for the public cpplint and there hasn't been a new release for two years, so to use new features, it's appropriate to specify a commit hash.

Copy link
Contributor

@esteve esteve left a comment

Choose a reason for hiding this comment

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

@mitsudome-r LGTM, thanks

Copy link
Member

@youtalk youtalk left a comment

Choose a reason for hiding this comment

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

LGTM
It's my fault. Thank you for the fix.

@youtalk youtalk merged commit 08afed3 into autowarefoundation:main Jul 2, 2024
18 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants