Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pallet::call macro does not preserve lint attributes #249

Open
2 tasks done
Tracked by #264
branan opened this issue Sep 19, 2022 · 1 comment
Open
2 tasks done
Tracked by #264

pallet::call macro does not preserve lint attributes #249

branan opened this issue Sep 19, 2022 · 1 comment
Labels
I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework.

Comments

@branan
Copy link

branan commented Sep 19, 2022

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Description of bug

The pallet procedural macro does not preserve any attributes on fns in a #[pallet::call] impl. This means that it is impossible to add a #[allow(lint)] or #[deny(lint)] attribute to a given call and have it be known/respected by the compiler.

It may make sense to filter unknown attributes from call fns in most cases, since they could be other procedural macros which could change things in ways that would break the expected contract of a call. However, I think that for developer ergonomics the lint macros should still be passed on to the compiler.

I believe that preserving allow, deny, and warn attributes is a fairly straightforward addition to the proc macro.

The workaround is to just use a global #![allow(lint)] for the entire crate, but that is less than ideal as it can mask new instances of a warning that a developer may care about.

Steps to reproduce

No response

@kianenigma
Copy link
Contributor

@sam0x17

@juangirini juangirini transferred this issue from paritytech/substrate Aug 24, 2023
@the-right-joyce the-right-joyce added I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework. and removed J0-enhancement labels Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
Status: Backlog
Development

No branches or pull requests

5 participants