From 19eb7728bbbb333a5c75b55036a2549ee2a901fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Fri, 3 Jan 2025 15:13:07 +0100 Subject: [PATCH] Allow clippy to break API, ignore a few initialism errors (#2840) --- esp-alloc/.clippy.toml | 1 + esp-hal-embassy/.clippy.toml | 1 + esp-hal/.clippy.toml | 1 + esp-hal/CHANGELOG.md | 3 +++ esp-hal/src/analog/adc/esp32.rs | 4 +++- esp-hal/src/analog/adc/mod.rs | 7 +++++-- esp-hal/src/analog/adc/riscv.rs | 4 +++- esp-hal/src/analog/adc/xtensa.rs | 4 +++- esp-hal/src/clock/mod.rs | 5 +++++ esp-hal/src/hmac.rs | 1 + esp-hal/src/i2s/master.rs | 1 + esp-hal/src/ledc/timer.rs | 1 + esp-hal/src/mcpwm/operator.rs | 1 + esp-hal/src/parl_io.rs | 1 + esp-hal/src/peripheral.rs | 2 +- esp-hal/src/rmt.rs | 1 + esp-hal/src/rtc_cntl/mod.rs | 12 +++++++++--- esp-hal/src/soc/esp32/gpio.rs | 4 ++-- esp-hal/src/soc/esp32c2/gpio.rs | 4 ++-- esp-hal/src/soc/esp32c3/gpio.rs | 4 ++-- esp-hal/src/soc/esp32c6/gpio.rs | 4 ++-- esp-hal/src/soc/esp32h2/gpio.rs | 4 ++-- esp-hal/src/soc/esp32s2/gpio.rs | 4 ++-- esp-hal/src/soc/esp32s3/gpio.rs | 4 ++-- esp-hal/src/spi/mod.rs | 1 + esp-hal/src/uart.rs | 4 ++++ esp-println/.clippy.toml | 1 + esp-storage/.clippy.toml | 1 + esp-wifi/.clippy.toml | 1 + esp-wifi/src/esp_now/mod.rs | 1 + esp-wifi/src/wifi/mod.rs | 2 ++ 31 files changed, 66 insertions(+), 23 deletions(-) create mode 100644 esp-alloc/.clippy.toml create mode 100644 esp-hal-embassy/.clippy.toml create mode 100644 esp-hal/.clippy.toml create mode 100644 esp-println/.clippy.toml create mode 100644 esp-storage/.clippy.toml create mode 100644 esp-wifi/.clippy.toml diff --git a/esp-alloc/.clippy.toml b/esp-alloc/.clippy.toml new file mode 100644 index 00000000000..cda8d17eed4 --- /dev/null +++ b/esp-alloc/.clippy.toml @@ -0,0 +1 @@ +avoid-breaking-exported-api = false diff --git a/esp-hal-embassy/.clippy.toml b/esp-hal-embassy/.clippy.toml new file mode 100644 index 00000000000..cda8d17eed4 --- /dev/null +++ b/esp-hal-embassy/.clippy.toml @@ -0,0 +1 @@ +avoid-breaking-exported-api = false diff --git a/esp-hal/.clippy.toml b/esp-hal/.clippy.toml new file mode 100644 index 00000000000..cda8d17eed4 --- /dev/null +++ b/esp-hal/.clippy.toml @@ -0,0 +1 @@ +avoid-breaking-exported-api = false diff --git a/esp-hal/CHANGELOG.md b/esp-hal/CHANGELOG.md index 985ff837bd0..af6485bebb1 100644 --- a/esp-hal/CHANGELOG.md +++ b/esp-hal/CHANGELOG.md @@ -53,6 +53,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The `ExtU64` and `RateExtU32` traits have been added to `esp_hal::time` (#2845) +- `adc::{AdcCalSource, Attenuation, Resolution}` now implement `Hash` and `defmt::Format` (#2840) +- `rtc_cntl::{RtcFastClock, RtcSlowClock, RtcCalSel}` now implement `PartialEq`, `Eq`, `Hash` and `defmt::Format` (#2840) + ### Changed - Bump MSRV to 1.83 (#2615) diff --git a/esp-hal/src/analog/adc/esp32.rs b/esp-hal/src/analog/adc/esp32.rs index afdb563adf1..93e003a0c7d 100644 --- a/esp-hal/src/analog/adc/esp32.rs +++ b/esp-hal/src/analog/adc/esp32.rs @@ -7,7 +7,9 @@ use crate::{ pub(super) const NUM_ATTENS: usize = 10; /// The sampling/readout resolution of the ADC. -#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names, reason = "peripheral is unstable")] pub enum Resolution { /// 9-bit resolution Resolution9Bit = 0b00, diff --git a/esp-hal/src/analog/adc/mod.rs b/esp-hal/src/analog/adc/mod.rs index e247e82aadc..2b899cfcbdd 100644 --- a/esp-hal/src/analog/adc/mod.rs +++ b/esp-hal/src/analog/adc/mod.rs @@ -70,7 +70,9 @@ mod implementation; /// The effective measurement range for a given attenuation is dependent on the /// device being targeted. Please refer to "ADC Characteristics" section of your /// device's datasheet for more information. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names, reason = "peripheral is unstable")] pub enum Attenuation { /// 0dB attenuation Attenuation0dB = 0b00, @@ -86,7 +88,8 @@ pub enum Attenuation { /// Calibration source of the ADC. #[cfg(not(esp32))] -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum AdcCalSource { /// Use Ground as the calibration source Gnd, diff --git a/esp-hal/src/analog/adc/riscv.rs b/esp-hal/src/analog/adc/riscv.rs index 9cd593f43f7..f4968cc5bb0 100644 --- a/esp-hal/src/analog/adc/riscv.rs +++ b/esp-hal/src/analog/adc/riscv.rs @@ -101,7 +101,9 @@ cfg_if::cfg_if! { } /// The sampling/readout resolution of the ADC. -#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names, reason = "peripheral is unstable")] pub enum Resolution { /// 12-bit resolution #[default] diff --git a/esp-hal/src/analog/adc/xtensa.rs b/esp-hal/src/analog/adc/xtensa.rs index d7d01d895fd..f92b7406f09 100644 --- a/esp-hal/src/analog/adc/xtensa.rs +++ b/esp-hal/src/analog/adc/xtensa.rs @@ -73,7 +73,9 @@ cfg_if::cfg_if! { } /// The sampling/readout resolution of the ADC. -#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names, reason = "peripheral is unstable")] pub enum Resolution { /// 13-bit resolution #[default] diff --git a/esp-hal/src/clock/mod.rs b/esp-hal/src/clock/mod.rs index 8923ebfa4c3..b39cfd35534 100644 --- a/esp-hal/src/clock/mod.rs +++ b/esp-hal/src/clock/mod.rs @@ -78,6 +78,11 @@ pub trait Clock { /// CPU clock speed #[derive(Debug, Clone, Copy, PartialEq, Eq)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow( + clippy::enum_variant_names, + reason = "MHz suffix indicates physical unit." +)] +/// FIXME: Remove Clock prefix once we can agree on a convention. pub enum CpuClock { /// 80MHz CPU clock #[cfg(not(esp32h2))] diff --git a/esp-hal/src/hmac.rs b/esp-hal/src/hmac.rs index 67b5e262074..31a699248b6 100644 --- a/esp-hal/src/hmac.rs +++ b/esp-hal/src/hmac.rs @@ -67,6 +67,7 @@ pub enum Error { /// user. It can also deliver to other peripherals. #[derive(Debug, Clone, Copy, PartialEq)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names, reason = "peripheral is unstable")] pub enum HmacPurpose { /// HMAC is used to re-enable JTAG after soft-disabling it. ToJtag = 6, diff --git a/esp-hal/src/i2s/master.rs b/esp-hal/src/i2s/master.rs index b63c755bc87..827b0215fc1 100644 --- a/esp-hal/src/i2s/master.rs +++ b/esp-hal/src/i2s/master.rs @@ -143,6 +143,7 @@ impl AcceptedWord for i32 {} /// I2S Error #[derive(Debug, Clone, Copy, PartialEq)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names, reason = "peripheral is unstable")] pub enum Error { /// An unspecified or unknown error occurred during an I2S operation. Unknown, diff --git a/esp-hal/src/ledc/timer.rs b/esp-hal/src/ledc/timer.rs index 1534feffc20..461360445db 100644 --- a/esp-hal/src/ledc/timer.rs +++ b/esp-hal/src/ledc/timer.rs @@ -68,6 +68,7 @@ pub mod config { /// Number of bits reserved for duty cycle adjustment #[derive(PartialEq, Eq, Copy, Clone, Debug)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] + #[allow(clippy::enum_variant_names)] // FIXME: resolve before stabilizing this driver pub enum Duty { /// 1-bit resolution for duty cycle adjustment. Duty1Bit = 1, diff --git a/esp-hal/src/mcpwm/operator.rs b/esp-hal/src/mcpwm/operator.rs index 7cf8d0c37f0..df0fe737d92 100644 --- a/esp-hal/src/mcpwm/operator.rs +++ b/esp-hal/src/mcpwm/operator.rs @@ -21,6 +21,7 @@ use crate::{ /// Input/Output Stream descriptor for each channel #[derive(Copy, Clone)] +#[allow(clippy::upper_case_acronyms, reason = "peripheral is unstable")] pub enum PWMStream { /// PWM Stream A PWMA, diff --git a/esp-hal/src/parl_io.rs b/esp-hal/src/parl_io.rs index ce6e3e5a232..29ee888cc6a 100644 --- a/esp-hal/src/parl_io.rs +++ b/esp-hal/src/parl_io.rs @@ -185,6 +185,7 @@ pub enum ParlIoInterrupt { /// Parallel IO errors #[derive(Debug, Clone, Copy, PartialEq)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names, reason = "peripheral is unstable")] pub enum Error { /// General DMA error DmaError(DmaError), diff --git a/esp-hal/src/peripheral.rs b/esp-hal/src/peripheral.rs index b1743ad7809..633f55eedeb 100644 --- a/esp-hal/src/peripheral.rs +++ b/esp-hal/src/peripheral.rs @@ -386,7 +386,7 @@ mod peripheral_macros { #[derive(Debug)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[non_exhaustive] - #[allow(non_camel_case_types)] + #[allow(non_camel_case_types, clippy::upper_case_acronyms)] /// Represents a virtual peripheral with no associated hardware. /// /// This struct is generated by the `create_peripheral!` macro when the peripheral diff --git a/esp-hal/src/rmt.rs b/esp-hal/src/rmt.rs index 1a72894659d..4e756a8d85a 100644 --- a/esp-hal/src/rmt.rs +++ b/esp-hal/src/rmt.rs @@ -239,6 +239,7 @@ use crate::{ /// Errors #[derive(Debug, Clone, Copy, PartialEq)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names, reason = "peripheral is unstable")] pub enum Error { /// The desired frequency is impossible to reach UnreachableTargetFrequency, diff --git a/esp-hal/src/rtc_cntl/mod.rs b/esp-hal/src/rtc_cntl/mod.rs index 6d1606d2c4c..8fb431c7ad9 100644 --- a/esp-hal/src/rtc_cntl/mod.rs +++ b/esp-hal/src/rtc_cntl/mod.rs @@ -176,7 +176,9 @@ unsafe fn lp_wdt<'a>() -> &'a ::Target { #[cfg(not(any(esp32c6, esp32h2)))] #[allow(unused)] -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names)] // FIXME: resolve this /// RTC SLOW_CLK frequency values pub(crate) enum RtcFastClock { /// Main XTAL, divided by 4 @@ -199,8 +201,10 @@ impl Clock for RtcFastClock { } #[cfg(not(any(esp32c6, esp32h2)))] -#[derive(Debug, Clone, Copy)] #[non_exhaustive] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names)] // FIXME: resolve this /// RTC SLOW_CLK frequency values pub enum RtcSlowClock { /// Internal slow RC oscillator @@ -232,7 +236,9 @@ impl Clock for RtcSlowClock { #[allow(unused)] #[cfg(not(any(esp32c6, esp32h2)))] -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names)] // FIXME: resolve this /// Clock source to be calibrated using rtc_clk_cal function pub(crate) enum RtcCalSel { /// Currently selected RTC SLOW_CLK diff --git a/esp-hal/src/soc/esp32/gpio.rs b/esp-hal/src/soc/esp32/gpio.rs index 2c0e38c4c6a..0c3bdb189b5 100644 --- a/esp-hal/src/soc/esp32/gpio.rs +++ b/esp-hal/src/soc/esp32/gpio.rs @@ -119,7 +119,7 @@ pub(crate) fn gpio_intr_enable(int_enable: bool, nmi_enable: bool) -> u8 { } /// Peripheral input signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] @@ -311,7 +311,7 @@ pub enum InputSignal { } /// Peripheral output signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] diff --git a/esp-hal/src/soc/esp32c2/gpio.rs b/esp-hal/src/soc/esp32c2/gpio.rs index 4416b324c4a..d0a79167274 100644 --- a/esp-hal/src/soc/esp32c2/gpio.rs +++ b/esp-hal/src/soc/esp32c2/gpio.rs @@ -63,7 +63,7 @@ pub(crate) fn gpio_intr_enable(int_enable: bool, nmi_enable: bool) -> u8 { } /// Peripheral input signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] @@ -104,7 +104,7 @@ pub enum InputSignal { } /// Peripheral output signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] diff --git a/esp-hal/src/soc/esp32c3/gpio.rs b/esp-hal/src/soc/esp32c3/gpio.rs index 11b99a08534..c7c153653fb 100644 --- a/esp-hal/src/soc/esp32c3/gpio.rs +++ b/esp-hal/src/soc/esp32c3/gpio.rs @@ -65,7 +65,7 @@ pub(crate) fn gpio_intr_enable(int_enable: bool, nmi_enable: bool) -> u8 { } /// Peripheral input signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] @@ -115,7 +115,7 @@ pub enum InputSignal { } /// Peripheral output signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] diff --git a/esp-hal/src/soc/esp32c6/gpio.rs b/esp-hal/src/soc/esp32c6/gpio.rs index 0be007b7227..240b178c565 100644 --- a/esp-hal/src/soc/esp32c6/gpio.rs +++ b/esp-hal/src/soc/esp32c6/gpio.rs @@ -65,7 +65,7 @@ pub(crate) fn gpio_intr_enable(int_enable: bool, nmi_enable: bool) -> u8 { } /// Peripheral input signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] @@ -170,7 +170,7 @@ pub enum InputSignal { } /// Peripheral input signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] diff --git a/esp-hal/src/soc/esp32h2/gpio.rs b/esp-hal/src/soc/esp32h2/gpio.rs index e1931c1371a..7b8ab39c149 100644 --- a/esp-hal/src/soc/esp32h2/gpio.rs +++ b/esp-hal/src/soc/esp32h2/gpio.rs @@ -63,7 +63,7 @@ pub(crate) fn gpio_intr_enable(int_enable: bool, nmi_enable: bool) -> u8 { } /// Peripheral input signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] @@ -149,7 +149,7 @@ pub enum InputSignal { } /// Peripheral input signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] diff --git a/esp-hal/src/soc/esp32s2/gpio.rs b/esp-hal/src/soc/esp32s2/gpio.rs index d4026f8d5b2..d6569239769 100644 --- a/esp-hal/src/soc/esp32s2/gpio.rs +++ b/esp-hal/src/soc/esp32s2/gpio.rs @@ -126,7 +126,7 @@ pub(crate) fn gpio_intr_enable(int_enable: bool, nmi_enable: bool) -> u8 { } /// Peripheral input signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] @@ -213,7 +213,7 @@ pub enum InputSignal { } /// Peripheral output signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] diff --git a/esp-hal/src/soc/esp32s3/gpio.rs b/esp-hal/src/soc/esp32s3/gpio.rs index b3c642fffee..51ca5683669 100644 --- a/esp-hal/src/soc/esp32s3/gpio.rs +++ b/esp-hal/src/soc/esp32s3/gpio.rs @@ -65,7 +65,7 @@ pub(crate) fn gpio_intr_enable(int_enable: bool, nmi_enable: bool) -> u8 { } /// Peripheral input signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] @@ -228,7 +228,7 @@ pub enum InputSignal { } /// Peripheral output signals for the GPIO mux -#[allow(non_camel_case_types)] +#[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[derive(Debug, PartialEq, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[doc(hidden)] // TODO connection operations are now public on these, we might want to publish diff --git a/esp-hal/src/spi/mod.rs b/esp-hal/src/spi/mod.rs index 591899a9a3e..6c23cede33a 100644 --- a/esp-hal/src/spi/mod.rs +++ b/esp-hal/src/spi/mod.rs @@ -25,6 +25,7 @@ pub enum Error { /// Error occurred due to a DMA-related issue. #[cfg(any(doc, feature = "unstable"))] #[cfg_attr(docsrs, doc(cfg(feature = "unstable")))] + #[allow(clippy::enum_variant_names, reason = "DMA is unstable")] DmaError(DmaError), /// Error indicating that the maximum DMA transfer size was exceeded. MaxDmaTransferSizeExceeded, diff --git a/esp-hal/src/uart.rs b/esp-hal/src/uart.rs index f14a73a73fe..36808e6680e 100644 --- a/esp-hal/src/uart.rs +++ b/esp-hal/src/uart.rs @@ -277,6 +277,7 @@ pub enum Error { /// /// This error occurs when the received data does not conform to the /// expected UART frame format. + #[allow(clippy::enum_variant_names, reason = "Frame error is a common term")] RxFrameError, /// A parity error was detected on the RX line. @@ -284,6 +285,7 @@ pub enum Error { /// This error occurs when the parity bit in the received data does not /// match the expected parity configuration. /// with the `async` feature. + #[allow(clippy::enum_variant_names, reason = "Parity error is a common term")] RxParityError, } @@ -369,6 +371,7 @@ pub enum DataBits { /// either even or odd. #[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names)] // FIXME: resolve this pub enum Parity { /// No parity bit is used (most common). #[default] @@ -388,6 +391,7 @@ pub enum Parity { /// bits. #[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names)] // FIXME: resolve this pub enum StopBits { /// 1 stop bit. #[default] diff --git a/esp-println/.clippy.toml b/esp-println/.clippy.toml new file mode 100644 index 00000000000..cda8d17eed4 --- /dev/null +++ b/esp-println/.clippy.toml @@ -0,0 +1 @@ +avoid-breaking-exported-api = false diff --git a/esp-storage/.clippy.toml b/esp-storage/.clippy.toml new file mode 100644 index 00000000000..cda8d17eed4 --- /dev/null +++ b/esp-storage/.clippy.toml @@ -0,0 +1 @@ +avoid-breaking-exported-api = false diff --git a/esp-wifi/.clippy.toml b/esp-wifi/.clippy.toml new file mode 100644 index 00000000000..cda8d17eed4 --- /dev/null +++ b/esp-wifi/.clippy.toml @@ -0,0 +1 @@ +avoid-breaking-exported-api = false diff --git a/esp-wifi/src/esp_now/mod.rs b/esp-wifi/src/esp_now/mod.rs index e43aa5abf9b..9149cb873c2 100644 --- a/esp-wifi/src/esp_now/mod.rs +++ b/esp-wifi/src/esp_now/mod.rs @@ -61,6 +61,7 @@ macro_rules! check_error { #[repr(u32)] #[derive(Debug)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names)] // FIXME avoid Error suffix, could use better names pub enum Error { /// ESP-NOW is not initialized. NotInitialized = 12389, diff --git a/esp-wifi/src/wifi/mod.rs b/esp-wifi/src/wifi/mod.rs index cb4ea3e3603..aee2f2281b1 100644 --- a/esp-wifi/src/wifi/mod.rs +++ b/esp-wifi/src/wifi/mod.rs @@ -158,6 +158,7 @@ use crate::binary::{ #[cfg_attr(feature = "defmt", derive(defmt::Format))] #[cfg_attr(feature = "serde", derive(Deserialize, Serialize))] #[derive(Default)] +#[allow(clippy::upper_case_acronyms)] // FIXME pub enum AuthMethod { /// No authentication (open network). None, @@ -1089,6 +1090,7 @@ pub enum WifiEvent { #[repr(i32)] #[derive(Copy, Clone, Debug, PartialEq, Eq, FromPrimitive)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] +#[allow(clippy::enum_variant_names)] // FIXME remove prefix pub enum InternalWifiError { /// Out of memory EspErrNoMem = 0x101,