# Umbrella lints

**URL:** <https://internals.rust-lang.org/t/umbrella-lints/307>\
**Category:** internals\
**Created:** [August 3, 2014, 10:15am UTC](https://internals.rust-lang.org/t/umbrella-lints/307 "2014-08-03T10:15:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![P1start](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/p1start/32/23_2.png) [@P1start](https://internals.rust-lang.org/u/P1start)\
**Post date:** [August 3, 2014, 10:15am UTC](https://internals.rust-lang.org/t/umbrella-lints/307/1 "2014-08-03T10:15:56Z")

</div>

I’ve had [a pull request](https://github.com/rust-lang/rust/pull/15773) open for quite some time now that adds ‘umbrella lints’, or lint groups, to the compiler. I’m posting this here because this is quite a significant addition to how lints work, and I (and the devs) want some feedback about it, but it’s not really RFC-worthy (probably) and is completely backwards-compatible. (There are some backwards-incompatible changes in my PR but those are largely unrelated.) Basically what this is is a way of having one lint that actually controls multiple lints. For example, my PR adds a built-in `bad_style` lint group that covers all of the existing style lints. This makes toggling on/off style checks significantly easier—instead of having to explictly `#[allow]` each and every style lint, one can just use `#[allow(bad_style)]` to turn off all style-related lints.

If anyone has any suggestions/objections, please let me know! (Particularly, any suggestions for a better name for the `bad_style` lint group would be appreciated.)

---

<div class="post-metadata">

**Author:** ![nikomatsakis](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/nikomatsakis/32/5410_2.png) [@nikomatsakis](https://internals.rust-lang.org/u/nikomatsakis)\
**Post date:** [August 4, 2014, 11:33am UTC](https://internals.rust-lang.org/t/umbrella-lints/307/2 "2014-08-04T11:33:49Z")

</div>

This seems like a good idea in general but I think we have to be very careful about versioning. Specifically, if a user sets their code to `forbid(bad_style)`, then adding new style lints becomes a breaking change, and hence would to be limited to major releases (per semantic versioning). This has certainly been a problem that prevents people from using `-Wall` and `-Werror` with `gcc`. (Note that this is not a problem without style groups: we can always add new lints so long as the default setting is not error.) It might be that the answer is just to incorporate some kind of rustc version number into the style group names.

---

<div class="post-metadata">

**Author:** ![reem](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/reem/32/167_2.png) [@reem](https://internals.rust-lang.org/u/reem)\
**Post date:** [August 5, 2014, 5:04am UTC](https://internals.rust-lang.org/t/umbrella-lints/307/3 "2014-08-05T05:04:46Z")

</div>

My gut feeling is that by opting to turn style-related warnings into failures through an an explicit `#[deny(bad_style)]` you are opting into failing builds as a result of style changes.

---

<div class="post-metadata">

**Author:** ![P1start](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/p1start/32/23_2.png) [@P1start](https://internals.rust-lang.org/u/P1start)\
**Post date:** [August 5, 2014, 7:18am UTC](https://internals.rust-lang.org/t/umbrella-lints/307/4 "2014-08-05T07:18:40Z")

</div>

@nikomatsakis That’s a good point, but I don’t consider it too much of a problem with lint groups exclusively because it’s also a problem (in a slightly different sense) with normal lints—if a lint is modified to be stricter, any code with that lint set to `deny` or `forbid` will stop working if there’s something that triggers the lint under the updated rules but not with the previous version of the lint. Making lints stricter is backwards-incompatible, and in the same way making lint groups stricter (i.e., adding more lints) is backwards-incompatible.

That said, I would assume that it’s more common to _add_ lints than modify them in a backwards-incompatible fashion, which means that breaking lint groups could be more common than breaking normal lints.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [March 25, 2019, 8:22am UTC](https://internals.rust-lang.org/t/umbrella-lints/307/5 "2019-03-25T08:22:42Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
