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(pre-commit): autoupdate #3013

Closed
wants to merge 2 commits into from
Closed
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
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-json
- id: check-merge-conflict
Expand All @@ -18,18 +18,18 @@ repos:
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.33.0
rev: v0.41.0
hooks:
- id: markdownlint
args: [-c, .markdownlint.yaml, --fix]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.6
rev: v4.0.0-alpha.8
hooks:
- id: prettier

- repo: https://github.com/adrienverge/yamllint
rev: v1.30.0
rev: v1.35.1
hooks:
- id: yamllint

Expand All @@ -44,29 +44,29 @@ repos:
- id: sort-package-xml

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.2
rev: v0.10.0.1
hooks:
- id: shellcheck

- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.6.0-2
rev: v3.8.0-1
hooks:
- id: shfmt
args: [-w, -s, -i=4]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.4.2
hooks:
- id: black
args: [--line-length=100]

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.0
rev: v18.1.6
hooks:
- id: clang-format
types_or: [c++, c, cuda]
Expand All @@ -79,7 +79,7 @@ repos:
exclude: .cu

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.2
rev: 0.28.4
hooks:
- id: check-metaschema
files: ^.+/schema/.*schema\.json$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ class NodeAdaptor
C & cli, S & srv, CallbackGroup group, std::optional<double> timeout = std::nullopt) const
{
init_cli(cli);
init_srv(
srv, [cli, timeout](auto req, auto res) { *res = *cli->call(req, timeout); }, group);
init_srv(srv, [cli, timeout](auto req, auto res) { *res = *cli->call(req, timeout); }, group);
}

/// Create a subscription wrapper.
Expand Down
3 changes: 1 addition & 2 deletions common/motion_utils/test/src/trajectory/test_trajectory.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 TIER IV, Inc.

Check notice on line 1 in common/motion_utils/test/src/trajectory/test_trajectory.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

✅ Getting better: Lines of Code in a Single File

The lines of code decreases from 4231 to 4230, improve code health by reducing it to 1000. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -5365,8 +5365,7 @@
auto traj = generateTestTrajectory<Trajectory>(10, 1.0, 1.0);

// no invalid points
testRemoveInvalidOrientationPoints(
traj, [](Trajectory &) {}, traj.points.size());
testRemoveInvalidOrientationPoints(traj, [](Trajectory &) {}, traj.points.size());

// invalid point at the end
testRemoveInvalidOrientationPoints(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,12 +560,12 @@ def update_input_queue(
np.array(time_stamp), np.array(steer_history)
)

self.acc_input_queue[
drive_functions.acc_ctrl_queue_size - acc_num :
] = acc_interpolate(time_stamp_acc)
self.steer_input_queue[
drive_functions.steer_ctrl_queue_size - steer_num :
] = steer_interpolate(time_stamp_steer)
self.acc_input_queue[drive_functions.acc_ctrl_queue_size - acc_num :] = (
acc_interpolate(time_stamp_acc)
)
self.steer_input_queue[drive_functions.steer_ctrl_queue_size - steer_num :] = (
steer_interpolate(time_stamp_steer)
)

if (
acc_num == drive_functions.acc_ctrl_queue_size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace kinematic_diagnostics
struct Parameters
{
std::array<bool, static_cast<size_t>(Metric::SIZE)> metrics{}; // default values to false
}; // struct Parameters
}; // struct Parameters

} // namespace kinematic_diagnostics

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ class EvalTest : public ::testing::Test
tf_broadcaster_ = std::make_unique<tf2_ros::TransformBroadcaster>(dummy_node);
}

~EvalTest() override
{ /*rclcpp::shutdown();*/
}
~EvalTest() override { /*rclcpp::shutdown();*/ }

void setTargetMetric(kinematic_diagnostics::Metric metric)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace localization_diagnostics
struct Parameters
{
std::array<bool, static_cast<size_t>(Metric::SIZE)> metrics{}; // default values to false
}; // struct Parameters
}; // struct Parameters

} // namespace localization_diagnostics

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,11 @@ def launch_setup(context, *args, **kwargs):
components.extend(
pipeline.create_single_frame_obstacle_segmentation_components(
input_topic=LaunchConfiguration("input/pointcloud"),
output_topic=pipeline.single_frame_obstacle_seg_output
if pipeline.use_single_frame_filter or pipeline.use_time_series_filter
else pipeline.output_topic,
output_topic=(
pipeline.single_frame_obstacle_seg_output
if pipeline.use_single_frame_filter or pipeline.use_time_series_filter
else pipeline.output_topic
),
)
)

Expand All @@ -512,18 +514,20 @@ def launch_setup(context, *args, **kwargs):
components.extend(
pipeline.create_single_frame_outlier_filter_components(
input_topic=pipeline.single_frame_obstacle_seg_output,
output_topic=relay_topic
if pipeline.use_time_series_filter
else pipeline.output_topic,
output_topic=(
relay_topic if pipeline.use_time_series_filter else pipeline.output_topic
),
context=context,
)
)
if pipeline.use_time_series_filter:
components.extend(
pipeline.create_time_series_outlier_filter_components(
input_topic=relay_topic
if pipeline.use_single_frame_filter
else pipeline.single_frame_obstacle_seg_output,
input_topic=(
relay_topic
if pipeline.use_single_frame_filter
else pipeline.single_frame_obstacle_seg_output
),
output_topic=pipeline.output_topic,
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ RoiPointCloudFusionNode::RoiPointCloudFusionNode(const rclcpp::NodeOptions & opt
cluster_debug_pub_ = this->create_publisher<sensor_msgs::msg::PointCloud2>("debug/clusters", 1);
}

void RoiPointCloudFusionNode::preprocess(__attribute__((unused))
sensor_msgs::msg::PointCloud2 & pointcloud_msg)
void RoiPointCloudFusionNode::preprocess(
__attribute__((unused)) sensor_msgs::msg::PointCloud2 & pointcloud_msg)
{
return;
}

void RoiPointCloudFusionNode::postprocess(__attribute__((unused))
sensor_msgs::msg::PointCloud2 & pointcloud_msg)
void RoiPointCloudFusionNode::postprocess(
__attribute__((unused)) sensor_msgs::msg::PointCloud2 & pointcloud_msg)
{
const auto objects_sub_count = pub_objects_ptr_->get_subscription_count() +
pub_objects_ptr_->get_intra_process_subscription_count();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,19 @@ def launch_setup(context, *args, **kwargs):
remappings=[
(
"~/input/obstacle_pointcloud",
LaunchConfiguration("input/obstacle_pointcloud")
if not downsample_input_pointcloud
else "obstacle/downsample/pointcloud",
(
LaunchConfiguration("input/obstacle_pointcloud")
if not downsample_input_pointcloud
else "obstacle/downsample/pointcloud"
),
),
(
"~/input/raw_pointcloud",
LaunchConfiguration("input/raw_pointcloud")
if not downsample_input_pointcloud
else "raw/downsample/pointcloud",
(
LaunchConfiguration("input/raw_pointcloud")
if not downsample_input_pointcloud
else "raw/downsample/pointcloud"
),
),
("~/output/occupancy_grid_map", LaunchConfiguration("output")),
],
Expand Down
2 changes: 1 addition & 1 deletion perception/tensorrt_yolox/src/tensorrt_yolox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ void TrtYoloX::generateYoloxProposals(
objects.push_back(obj);
}
} // class loop
} // point anchor loop
} // point anchor loop
}

void TrtYoloX::qsortDescentInplace(ObjectArray & face_objects, int left, int right) const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,7 @@ std::vector<autoware::sampler_common::Path> PathSampler::generateCandidatesFromP
size_t reuse_idx = 0;
for (reuse_idx = 0; reuse_idx + 1 < prev_path_->lengths.size() &&
prev_path_->lengths[reuse_idx] < reuse_length;
++reuse_idx)
;
++reuse_idx);
if (reuse_idx == 0UL) continue;
const auto reused_path = *prev_path_->subset(0UL, reuse_idx);
reuse_state.curvature = reused_path.curvatures.back();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void pcl::PassThroughUInt16<pcl::PCLPointCloud2>::applyFilter(PCLPointCloud2 & o
nr_p++;
}
output.width = nr_p;
} // !keep_organized_
} // !keep_organized_
} else { // No distance filtering, process all data.
// No need to check for is_organized here as we did it above
for (int cp = 0; cp < nr_points; ++cp, xyz_offset += input_->point_step) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void pcl::VoxelGridNearestCentroid<PointT>::applyFilter(PointCloud & output)
&rgb, reinterpret_cast<const char *>(&input_->points[cp]) + rgba_index, sizeof(int));
centroid[centroid_size - 3] = static_cast<float>((rgb >> 16) & 0x0000ff);
centroid[centroid_size - 2] = static_cast<float>((rgb >> 8) & 0x0000ff);
centroid[centroid_size - 1] = static_cast<float>((rgb)&0x0000ff);
centroid[centroid_size - 1] = static_cast<float>((rgb) & 0x0000ff);
}
pcl::for_each_type<FieldList>(
NdCopyPointEigenFunctor<PointT>(input_->points[cp], centroid));
Expand Down Expand Up @@ -272,7 +272,7 @@ void pcl::VoxelGridNearestCentroid<PointT>::applyFilter(PointCloud & output)
&rgb, reinterpret_cast<const char *>(&input_->points[cp]) + rgba_index, sizeof(int));
centroid[centroid_size - 3] = static_cast<float>((rgb >> 16) & 0x0000ff);
centroid[centroid_size - 2] = static_cast<float>((rgb >> 8) & 0x0000ff);
centroid[centroid_size - 1] = static_cast<float>((rgb)&0x0000ff);
centroid[centroid_size - 1] = static_cast<float>((rgb) & 0x0000ff);
}
pcl::for_each_type<FieldList>(
NdCopyPointEigenFunctor<PointT>(input_->points[cp], centroid));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@

#define raspiThermalThrottlingMask (raspiCurrentlyThrottled | raspiSoftTemperatureLimitActive)

#define throttledToString(X) \
(((X)&raspiUnderVoltageDetected) ? "Under-voltage detected" \
: ((X)&raspiArmFrequencyCapped) ? "Arm frequency capped" \
: ((X)&raspiCurrentlyThrottled) ? "Currently throttled" \
: ((X)&raspiSoftTemperatureLimitActive) ? "Soft temperature limit active" \
: ((X)&raspiUnderVoltageHasOccurred) ? "Under-voltage has occurred" \
: ((X)&raspiArmFrequencyCappedHasOccurred) ? "Arm frequency capped has occurred" \
: ((X)&raspiThrottlingHasOccurred) ? "Throttling has occurred" \
: ((X)&raspiSoftTemperatureLimitHasOccurred) ? "Soft temperature limit has occurred" \
: "UNKNOWN")
#define throttledToString(X) \
(((X) & raspiUnderVoltageDetected) ? "Under-voltage detected" \
: ((X) & raspiArmFrequencyCapped) ? "Arm frequency capped" \
: ((X) & raspiCurrentlyThrottled) ? "Currently throttled" \
: ((X) & raspiSoftTemperatureLimitActive) ? "Soft temperature limit active" \
: ((X) & raspiUnderVoltageHasOccurred) ? "Under-voltage has occurred" \
: ((X) & raspiArmFrequencyCappedHasOccurred) ? "Arm frequency capped has occurred" \
: ((X) & raspiThrottlingHasOccurred) ? "Throttling has occurred" \
: ((X) & raspiSoftTemperatureLimitHasOccurred) ? "Soft temperature limit has occurred" \
: "UNKNOWN")

class CPUMonitor : public CPUMonitorBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@
#include <string>
#include <vector>

#define reasonToString(X) \
(((X)&nvmlClocksThrottleReasonGpuIdle) ? "GpuIdle" \
: ((X)&nvmlClocksThrottleReasonApplicationsClocksSetting) ? "ApplicationsClocksSetting" \
: ((X)&nvmlClocksThrottleReasonSwPowerCap) ? "SwPowerCap" \
: ((X)&nvmlClocksThrottleReasonHwSlowdown) ? "HwSlowdown" \
: ((X)&nvmlClocksThrottleReasonSyncBoost) ? "SyncBoost" \
: ((X)&nvmlClocksThrottleReasonSwThermalSlowdown) ? "SwThermalSlowdown" \
: ((X)&nvmlClocksThrottleReasonHwThermalSlowdown) ? "HwThermalSlowdown" \
: ((X)&nvmlClocksThrottleReasonHwPowerBrakeSlowdown) ? "HwPowerBrakeSlowdown" \
: ((X)&nvmlClocksThrottleReasonDisplayClockSetting) ? "DisplayClockSetting" \
: "UNKNOWN")
#define reasonToString(X) \
(((X) & nvmlClocksThrottleReasonGpuIdle) ? "GpuIdle" \
: ((X) & nvmlClocksThrottleReasonApplicationsClocksSetting) ? "ApplicationsClocksSetting" \
: ((X) & nvmlClocksThrottleReasonSwPowerCap) ? "SwPowerCap" \
: ((X) & nvmlClocksThrottleReasonHwSlowdown) ? "HwSlowdown" \
: ((X) & nvmlClocksThrottleReasonSyncBoost) ? "SyncBoost" \
: ((X) & nvmlClocksThrottleReasonSwThermalSlowdown) ? "SwThermalSlowdown" \
: ((X) & nvmlClocksThrottleReasonHwThermalSlowdown) ? "HwThermalSlowdown" \
: ((X) & nvmlClocksThrottleReasonHwPowerBrakeSlowdown) ? "HwPowerBrakeSlowdown" \
: ((X) & nvmlClocksThrottleReasonDisplayClockSetting) ? "DisplayClockSetting" \
: "UNKNOWN")

/**
* @brief GPU information
Expand Down
Loading