Unify Lint Policy? #4128
Replies: 2 comments 6 replies
-
|
This is a painful area in proc_macros in general because to my knowledge lints are not possible on stable. cfg_lint called a nightly-only API This might've changed in the years since the lints were added so it's worth reevaluating |
Beta Was this translation helpful? Give feedback.
-
|
Here's a crazy idea, that might just work. Instead of emitting a hard error and a lint, we could emit a small helper function #[deprecated = "why not to use this syntax"]
fn deprecated<T>(t: T) -> T { t }and make sure to call this in the emitted code. I agree that a hard error for deprecated syntax is bad UX. The old code is functionally fine and stylistic choices should not lead to hard errors. I'm actually not 100% convinced that all these lints are air-tight, any false positive would lead to unavoidable compile errors that can't be ignored. The above could be locally or globally ignored with a All of this under the assumption that no other diagnostics work, the underlying Diagnostic are still nightly only. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
#4118 introduced a special class of deprecation lints that are warnings on nightly and are hard errors otherwise.
Conflicts to be resolved
yew_lintcfg flag at all.<a>) are disabled by default and enabled on a opt-in bases. While the deprecation lints are always on.My Opinion
Our previous html lints are too quiet. A user has to pass the cfg flag and be on nightly. The fact that the
yew_lintflag isn't documented anywhere doesn't help. Honestly I have never used the flag during my years of using Yew. Mostly not remembering it existed, despite being on nightly all the time.Action
A possibility is we handle these classes of lints seperatly (because they indeed are about different things. One is about deprecated yew patterns and the other is about html standards). Then we don't need to change to the code. We just need to document the yew_lint flag better. We can also consider adding the flag to the yew-trunk-minimal-template.
I want to get more input on this before doing anything. Tagging some people here:
@ranile who created the yew_lint cfg flag
@its-the-shrimp who worked on the String vs AttrValue lint
@WorldSEnder active maintainer
@kirillsemyonkin who said "matt why is this a hard error"
@stifskere who suggested the warning plus hard error behavior
Beta Was this translation helpful? Give feedback.
All reactions