Skip to content

Commit

Permalink
feat: Trailing comma error message (#655)
Browse files Browse the repository at this point in the history
* feat: adds macro check for trailing comma

* feat: adds macro check for trailing comma

* Update src/query.rs

* feat: adds macro check for trailing comma

---------

Co-authored-by: Predrag Gruevski <[email protected]>
  • Loading branch information
devanbenz and obi1kenobi authored Feb 11, 2024
1 parent 53dbd29 commit a6d0a00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ localdata/

# Editor-local configuration
.vscode/
.idea

# Unnecessary test data
test_crates/**/Cargo.lock
5 changes: 4 additions & 1 deletion src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ mod tests {
}

macro_rules! add_lints {
($($name:ident,)*) => {
($($name:ident,)+) => {
#[cfg(test)]
mod tests_lints {
$(
Expand All @@ -462,6 +462,9 @@ macro_rules! add_lints {
)*
]
}
};
($($name:ident),*) => {
compile_error!("Please add a trailing comma after each lint identifier. This ensures our scripts like 'make_new_lint.sh' can safely edit invocations of this macro as needed.");
}
}

Expand Down

0 comments on commit a6d0a00

Please sign in to comment.