Allow clippy to break API, ignore a few initialism errors (#2840)
This commit is contained in:
parent
551386216e
commit
19eb7728bb
1
esp-alloc/.clippy.toml
Normal file
1
esp-alloc/.clippy.toml
Normal file
@ -0,0 +1 @@
|
||||
avoid-breaking-exported-api = false
|
||||
1
esp-hal-embassy/.clippy.toml
Normal file
1
esp-hal-embassy/.clippy.toml
Normal file
@ -0,0 +1 @@
|
||||
avoid-breaking-exported-api = false
|
||||
1
esp-hal/.clippy.toml
Normal file
1
esp-hal/.clippy.toml
Normal file
@ -0,0 +1 @@
|
||||
avoid-breaking-exported-api = false
|
||||
@ -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)
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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]
|
||||
|
||||
@ -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]
|
||||
|
||||
@ -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))]
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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),
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -176,7 +176,9 @@ unsafe fn lp_wdt<'a>() -> &'a <LPWR as core::ops::Deref>::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
|
||||
|
||||
@ -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)]
|
||||
|
||||
@ -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)]
|
||||
|
||||
@ -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)]
|
||||
|
||||
@ -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)]
|
||||
|
||||
@ -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)]
|
||||
|
||||
@ -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)]
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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]
|
||||
|
||||
1
esp-println/.clippy.toml
Normal file
1
esp-println/.clippy.toml
Normal file
@ -0,0 +1 @@
|
||||
avoid-breaking-exported-api = false
|
||||
1
esp-storage/.clippy.toml
Normal file
1
esp-storage/.clippy.toml
Normal file
@ -0,0 +1 @@
|
||||
avoid-breaking-exported-api = false
|
||||
1
esp-wifi/.clippy.toml
Normal file
1
esp-wifi/.clippy.toml
Normal file
@ -0,0 +1 @@
|
||||
avoid-breaking-exported-api = false
|
||||
@ -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,
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user