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

refactor(stop_filter): apply static analysis #7302

Conversation

a-maumau
Copy link
Contributor

@a-maumau a-maumau commented Jun 6, 2024

Description

This PR is to apply some of the suggestions from linter.

This PR will change the function/method name from camelCase to snake_case.

Tests performed

Used following commands for checking the codes

#!/bin/bash
set -eux

TARGET_DIR=$1

current_dir=$(basename $(pwd))
if [[ ! $current_dir =~ ^(autoware|pilot-auto) ]]; then
    echo "This script must be run in a directory with a prefix of autoware or pilot-auto."
    exit 1
fi

set +eux
export CPLUS_INCLUDE_PATH=/usr/include/c++/11:/usr/include/x86_64-linux-gnu/c++/11:$CPLUS_INCLUDE_PATH
set -eux

fdfind -e cpp -e hpp --full-path ${TARGET_DIR} | xargs -P $(nproc) -I{} cpplint {}
fdfind -e cpp -e hpp --full-path ${TARGET_DIR} | xargs -P $(nproc) -I{} clang-tidy -p build/ {}

Before fixing the code:

...
14239 warnings generated.
/home/masakibaba/autoware/src/universe/autoware.universe/localization/stop_filter/include/stop_filter/stop_filter.hpp:55:8: warning: invalid case style for function 'callbackOdometry' [readability-identifier-naming]
  void callbackOdometry(const nav_msgs::msg::Odometry::SharedPtr msg);
       ^~~~~~~~~~~~~~~~
       callback_odometry
Suppressed 14249 warnings (14238 in non-user code, 11 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
17333 warnings generated.
Suppressed 17344 warnings (17333 in non-user code, 11 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

Check with cppcheck: (nothing specific)


After this PR:

...
14238 warnings generated.
Suppressed 14249 warnings (14238 in non-user code, 11 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
17332 warnings generated.
Suppressed 17343 warnings (17332 in non-user code, 11 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.

Effects on system behavior

Not applicable.

Interface changes

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.

Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com>
@SakodaShintaro SakodaShintaro added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jun 6, 2024
@github-actions github-actions bot added the component:localization Vehicle's position determination in its environment. (auto-assigned) label Jun 6, 2024
Copy link
Contributor

@SakodaShintaro SakodaShintaro left a comment

Choose a reason for hiding this comment

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

I have confirmed logging_simulator works well.
Look Good To Me

@SakodaShintaro SakodaShintaro enabled auto-merge (squash) June 6, 2024 09:09
@SakodaShintaro SakodaShintaro merged commit 31c1672 into autowarefoundation:main Jun 6, 2024
23 of 25 checks passed
KhalilSelyan pushed a commit that referenced this pull request Jul 22, 2024
change to snake_case

Signed-off-by: a-maumau <maumaumaumaumaumaumaumaumaumau@gmail.com>
Co-authored-by: SakodaShintaro <shintaro.sakoda@tier4.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:localization Vehicle's position determination in its environment. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants