-
Notifications
You must be signed in to change notification settings - Fork 767
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
Allow for custom clippy lints for FRAME pallets #163
Comments
Usually no it doesn't discard anything put its own My hypothesis is that the error comes from the code generated by the pallet, which is not covered by the added attribute in the example, probably this code here https://github.com/paritytech/substrate/blob/242858f392ad3062c9d3b2fe6c34989c1839c66c/frame/support/procedural/src/pallet/expand/error.rs#L156
Maybe for all the generated code and only the generated code we can add a clippy attribute which makes sure only the subset of lint that substrate support his code are checked on it, without requiring the user to specify anything. |
This would also be a viable solution. I tried to do that with a |
Plus, I feel this should be applied pretty much to any generated code. We had other issues also inside the benchmarking macros and the |
Hi! Has there been any progress or further discussion on this issue? It would enable downstream projects, such as ourselves, to add our own clippy config without incurring into Polkadot-generated warnings. |
SO IIUC we want to keep plastering more polkadot-sdk/substrate/frame/support/procedural/src/construct_runtime/expand/origin.rs Lines 203 to 213 in 22393d5
Sounds good to me, maybe @wentelteefje can to take a stab? |
@ggwpez this is the PR we were working on: KILTprotocol/kilt-node#529 Specifically, this is the initial set of flags we were considering to add in
|
* Dockerfile for OpenEth. * Add relayer dockerfile. * Add docker-compose. * Working on the relay. * Bump a bunch of deps. * Change relay branch. * Running a 3-validators poa network. * Add bridge nodes. * Conditional compilation of bridge configs. * Fix genesis hash. * Disable features build. * Disable empty steps. * Work on sub2eth * Add some logs. * More logs. * Fix compilation. * Add chain-id parameter to relay. * Unify bridge-hash. * Update the hash. * Ditch sub2eth for now. * Add some docs & proxy configuration. * Fixes. * Fix remaining issues. * Increase health timeout. * Make sure to install curl for health monitoring. * Fix kovan. * Fix build. * Create if does not exist. * Fix benches. * Revert CLI params requirements. * cargo fmt --all * Apply suggestions from code review Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com> * Add some docs. * Update BRIDGE_HASH to master * Duplicate compose file. * Rename testpoa to Rialto. * Fix borked merge. * Fix entrypoints to take arguments. Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
* Enable fast runtime by default * Add genesis config for EthereumSystem * Enable meta-hash extension * Fix test to construct extrinsic
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Motivation
We are experimenting with more stringent Clippy lints. We have tried different approaches, and all of them hit us back when linting our pallets.
My assumption is that the
#[frame_support::pallet]
macro discards anything it does not recognize, including any#[allow(clippy::all)]
.Screenshot:
Request
We would like to have granular control over what lints are disabled where, and right now this is not possible. The only way to lint our code without errors is to disable those lints crate-wise, which is not what we want.
Solution
Not sure what the best solution is, but one possible solution would be to let developers specify Clippy lint configurations before each #[pallet:*] macro, especially since they internally have not followed the strictest linting rules, hence getting in the way of projects that have enabled such stricter rules.
Are you willing to help with this request?
Maybe (please elaborate above)
The text was updated successfully, but these errors were encountered: