Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tidy lints

42 views
Skip to first unread message

Emilio Cobos Álvarez

unread,
Aug 18, 2018, 12:28:20 PM8/18/18
to dev-...@lists.mozilla.org
I don't think the following tidy lints are very useful, and they always
make me spend some extra time fixing them up every time I sync code from
mozilla-central:

* #[derive] trait name order.
* Lints that check `use` statements.

Do people generally find them useful?

I don't really think they are, and given we don't have an automatic way
to fix them (something like `./mach test-tidy --fix`) I'd prefer to
remove them, or to make `style` at least not require them. My feeling is
that their usefulness is just too little to justify the amount of time I
(and I suspect others) end up battling them.

What do you think?

Thanks,

-- Emilio

Anthony Ramine

unread,
Aug 19, 2018, 5:17:13 AM8/19/18
to dev-...@lists.mozilla.org
I personally think they are extremely useful, because if they don't exist I end up fixing order of things when I touch code around them. It's almost obsessive.

That being said, it's 2018 and rustfix should be doing it for us.

Emilio Cobos Álvarez

unread,
Aug 19, 2018, 7:59:05 AM8/19/18
to dev-...@lists.mozilla.org
On 08/19/2018 11:17 AM, Anthony Ramine wrote:
> I personally think they are extremely useful, because if they don't exist I end up fixing order of things when I touch code around them. It's almost obsessive.

Can we enable import reordering in rustfmt instead?

-- Emilio

Anthony Ramine

unread,
Aug 19, 2018, 8:18:30 AM8/19/18
to dev-...@lists.mozilla.org
I don't know, but if your question is "would you mind using a tool to automate that stuff instead of a lint that complains?" then my answer is "yes, I too don't enjoy reordering things by hand".

Bobby Holley

unread,
Aug 19, 2018, 1:43:45 PM8/19/18
to dev-servo
Yeah. It's probably less important exactly what the order is and more that
there's a canonical order that a tool can detect and automatically fix
things to match. rustfmt fits the bill, so I think it makes sense to retire
that particular tidy lint.
> _______________________________________________
> dev-servo mailing list
> dev-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-servo
>

Anthony Ramine

unread,
Aug 19, 2018, 2:10:32 PM8/19/18
to dev-...@lists.mozilla.org
We don't make use of rustfmt yet though (right? I was under a rock for 2 weeks so if I missed this excellent improvement, ignore me), so let's do that first IMO.

Josh Bowman-Matthews

unread,
Aug 19, 2018, 3:56:01 PM8/19/18
to dev-...@lists.mozilla.org
https://github.com/servo/servo/issues/21373 is tracking getting us
formatted so that we can turn rustfmt on everywhere by default. Once we
encounter the first cases of rustfmt's ordering not matching test-tidy,
we can disable Servo's use ordering lint in order to merge those PRs.

Cheers,
Josh

Emilio Cobos Álvarez

unread,
Aug 19, 2018, 4:13:53 PM8/19/18
to dev-...@lists.mozilla.org
On 8/19/18 9:54 PM, Josh Bowman-Matthews wrote:
> On 8/19/18 2:10 PM, Anthony Ramine wrote:
> https://github.com/servo/servo/issues/21373 is tracking getting us
> formatted so that we can turn rustfmt on everywhere by default. Once we
> encounter the first cases of rustfmt's ordering not matching test-tidy,
> we can disable Servo's use ordering lint in order to merge those PRs.

We should probably re-enable rustfmt's import-reordering then[1], right?
I'll send a PR tomorrow if nobody wins me to that :)

-- Emilio

[1]:
https://github.com/servo/servo/blob/d34403047e806fa6c8c2468946f64429622ec434/rustfmt.toml#L4

> Cheers,
> Josh

Josh Bowman-Matthews

unread,
Aug 20, 2018, 7:38:00 AM8/20/18
to dev-...@lists.mozilla.org
Oh, I didn't realize we already had a configuration. If we can keep that
reordering disabled until we're done merging the rest of the rustfmt
changes, that will be easier in the long run. Then we can merge a mass
reordering of the entire project all at once and disable the tidy lint
at the same time as we turn on rustfmt on CI.

Cheers,
Josh
0 new messages