Add back user-space clippy allows
@@ -52,6 +52,7 @@ pub fn generate(
let result = result_type();
let parser_impl = quote! {
+ #[allow(clippy::all)]
impl #impl_generics ::pest::Parser<Rule> for #name #ty_generics #where_clause {
fn parse<'i>(
rule: Rule,
@@ -61,6 +62,7 @@ pub fn generate(
::pest::error::Error<Rule>
> {
mod rules {
+ #![allow(clippy::upper_case_acronyms)]
pub mod hidden {
use super::super::Rule;
#skip
@@ -178,7 +180,7 @@ fn generate_enum(rules: &[OptimizedRule], uses_eoi: bool) -> TokenStream {
.map(|rule| Ident::new(rule.name.as_str(), Span::call_site()));
if uses_eoi {
quote! {
- #[allow(dead_code, non_camel_case_types)]
+ #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum Rule {
EOI,
@@ -187,7 +189,7 @@ fn generate_enum(rules: &[OptimizedRule], uses_eoi: bool) -> TokenStream {
}
} else {
quote! {
- #[allow(dead_code, non_camel_case_types)]
+ #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum Rule {
#( #rules ),*
@@ -663,7 +665,7 @@ mod tests {
assert_eq!(
generate_enum(&rules, false).to_string(),
quote! {
- #[allow(dead_code, non_camel_case_types)]
+ #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum Rule {
f
@@ -965,12 +967,13 @@ mod tests {
#[allow(non_upper_case_globals)]
const _PEST_GRAMMAR_MyParser: &'static str = include_str!("test.pest");
- #[allow(dead_code, non_camel_case_types)]
+ #[allow(dead_code, non_camel_case_types, clippy::upper_case_acronyms)]
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum Rule {
a
}
+ #[allow(clippy::all)]
impl ::pest::Parser<Rule> for MyParser {
fn parse<'i>(
rule: Rule,
@@ -980,6 +983,7 @@ mod tests {
::pest::error::Error<Rule>
> {
mod rules {
+ #![allow(clippy::upper_case_acronyms)]
pub mod hidden {
use super::super::Rule;
