Skip to content

Commit 47f18a1

Browse files
committed
Silence certain clippy lints on generated code
In case a user enforces clippy linting on these generated packages, silence expected warnings. This is already the case in rclrs, but should be applied directly to the generated packages for the sake of downstream users. The `clippy::derive_partial_eq_without_eq` lint was already being disabled for the packages vendored by rclrs, but is now moved to the rosidl_generator_rs template instead. This is necessary since we always derive the PartialEq trait, but can't necessary derive Eq, and so don't. The `clippy::upper_case_acronyms` is new and was added to account for message type names being upper-case acrynyms, like unique_identifier_msgs::msg::UUID.
1 parent 88f097c commit 47f18a1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

rclrs/vendor_interfaces.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ def main():
6161

6262
mod_contents = "//! Created by {}\n".format(Path(__file__).name)
6363
mod_contents += "#![allow(dead_code)]\n"
64-
mod_contents += "#![allow(clippy::derive_partial_eq_without_eq)]\n"
6564
mod_contents += "\n"
6665
for pkg in vendored_packages:
6766
mod_contents += f"pub mod {pkg};\n"

rosidl_generator_rs/resource/lib.rs.em

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#![allow(non_camel_case_types)]
2+
#![allow(clippy::derive_partial_eq_without_eq)]
3+
#![allow(clippy::upper_case_acronyms)]
24

35
@[if len(msg_specs) > 0]@
46
pub mod msg;

0 commit comments

Comments
 (0)