Skip to content

Fix clang-tidy errors#173

Open
aryanputta wants to merge 1 commit into
PickNikRobotics:mainfrom
aryanputta:fix-clang-tidy-issue-168
Open

Fix clang-tidy errors#173
aryanputta wants to merge 1 commit into
PickNikRobotics:mainfrom
aryanputta:fix-clang-tidy-issue-168

Conversation

@aryanputta

Copy link
Copy Markdown

Summary

  • replaces #pragma once with include guards in the public RSL headers flagged by clang-tidy
  • switches Queue's simple mutex guards to std::scoped_lock
  • parenthesizes the queue size assertion flagged by readability-math-missing-parentheses
  • keeps the existing C++17 contract by locally suppressing the C++20-only modernize-use-constraints and modernize-use-std-numbers suggestions with comments

Fixes #168.

Validation

  • pre-commit run --files include/rsl/algorithm.hpp include/rsl/monad.hpp include/rsl/no_discard.hpp include/rsl/overload.hpp include/rsl/parameter_validators.hpp include/rsl/queue.hpp include/rsl/random.hpp include/rsl/static_string.hpp include/rsl/static_vector.hpp include/rsl/strong_type.hpp include/rsl/try.hpp src/random.cpp tests/queue.cpp
  • git diff --check
  • c++ -std=c++17 -Iinclude -fsyntax-only -x c++-header include/rsl/queue.hpp
  • c++ -std=c++17 -Iinclude -fsyntax-only -x c++-header include/rsl/algorithm.hpp
  • c++ -std=c++17 -Iinclude -fsyntax-only -x c++-header include/rsl/no_discard.hpp

I could not run the full CMake/ROS test matrix locally on macOS: the repo preset assumes Linux lld, and a local CMake configure without that preset stops on missing ROS/Eigen dependencies. The GitHub Actions matrix should cover the full ROS/clang-tidy path.

@aryanputta aryanputta force-pushed the fix-clang-tidy-issue-168 branch from 49f44ec to 14e584e Compare June 26, 2026 08:32

@christophfroehlich christophfroehlich left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Duplicate of #171

Can you please check the existing PR, and comment there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix clang-tidy errors

2 participants