Stream: t-compiler/wg-mir-opt

Topic: rustfmt


Santiago Pastorino (Apr 30 2019 at 16:13, on Zulip):

also, I saw you pointed to a weird indent thing

Santiago Pastorino (Apr 30 2019 at 16:13, on Zulip):

I wonder how most of the people deal with this kind of stuff

Santiago Pastorino (Apr 30 2019 at 16:13, on Zulip):

that was specifically the indentation offered by vim

Santiago Pastorino (Apr 30 2019 at 16:13, on Zulip):

most of the time I just use rustfmt

Santiago Pastorino (Apr 30 2019 at 16:13, on Zulip):

but of course I don't want to do that during this PR

Santiago Pastorino (Apr 30 2019 at 16:13, on Zulip):

:)

Santiago Pastorino (Apr 30 2019 at 16:13, on Zulip):

it would become unmergeable forever

Santiago Pastorino (Apr 30 2019 at 16:13, on Zulip):

unless the files I deal with are already rustfmted

Santiago Pastorino (Apr 30 2019 at 16:14, on Zulip):

I'd really really love to see a rustfmt --over-git-diffs

oli (Apr 30 2019 at 16:14, on Zulip):

yea... It's super uncool, but I guess we're working on it

oli (Apr 30 2019 at 16:15, on Zulip):

rustfix and clippy via x.py are already becoming a thing

oli (Apr 30 2019 at 16:15, on Zulip):

Maybe we can make tidy have a blacklist of not-rustfmted things and slowly remove things from that blacklist

centril (Apr 30 2019 at 16:20, on Zulip):

@oli I think that's the basic idea petrochenkov had to prove it out

centril (Apr 30 2019 at 16:20, on Zulip):

much like the edition migration

Santiago Pastorino (Apr 30 2019 at 16:45, on Zulip):

:+1:

Santiago Pastorino (Apr 30 2019 at 16:45, on Zulip):

sounds good

Santiago Pastorino (Apr 30 2019 at 16:46, on Zulip):

anyway seems like rustfmt over the diffs would be great :)

centril (Apr 30 2019 at 16:48, on Zulip):

@Santiago Pastorino someone just needs to implement everything and we are golden :D

centril (Apr 30 2019 at 16:48, on Zulip):

maybe we should just make E-easy issues and someone will magically pick it up

Santiago Pastorino (Apr 30 2019 at 16:57, on Zulip):

yes :)

centril (Apr 30 2019 at 16:57, on Zulip):

@simulacrum ^--- maybe you can write something up since you had ideas?

Santiago Pastorino (Apr 30 2019 at 17:09, on Zulip):

if sounds interesting I can just open an issue on rustfmt

Santiago Pastorino (Apr 30 2019 at 17:10, on Zulip):

but more than an issue is the ability to add a feature

Santiago Pastorino (Apr 30 2019 at 17:10, on Zulip):

to run rustfmt over a list of range of lines of code

Santiago Pastorino (Apr 30 2019 at 17:11, on Zulip):

like from line 1 to 10, then from 20 to 40 and so on

Santiago Pastorino (Apr 30 2019 at 17:11, on Zulip):

and on top of that build adapters for different scms

centril (Apr 30 2019 at 17:51, on Zulip):

@Santiago Pastorino we also need x.py support and tidy checks

centril (Apr 30 2019 at 17:51, on Zulip):

and eventually possibly some @bors fmt command

simulacrum (Apr 30 2019 at 18:16, on Zulip):

I don't have any firm ideas, I personally think that rustfmt in theory shouldn't really need deep integration into rustbuild since dependencies shouldn't need to be built

centril (Apr 30 2019 at 18:23, on Zulip):

@simulacrum I was thinking more like mentoring instructions :P

simulacrum (Apr 30 2019 at 18:24, on Zulip):

I'm not quite sure for what though

simulacrum (Apr 30 2019 at 18:24, on Zulip):

if it's x.py fmt then I imagine it wouldn't be too hard to do so, but I also don't think it's super necessary.

Santiago Pastorino (Apr 30 2019 at 18:27, on Zulip):

I think there are two different things one is the integration with the compiler and the other one is having rustfmt be able to use git diffs to only affect the changed lines and not the entire file

Santiago Pastorino (Apr 30 2019 at 18:27, on Zulip):

I was mainly talking about the second thing

Santiago Pastorino (Apr 30 2019 at 18:27, on Zulip):

the integration with the compiler is a thing that I know was being discussed but seems to me something more like mid/long term

Santiago Pastorino (Apr 30 2019 at 18:28, on Zulip):

if you're able to run rustfmt over diffs could be something one could apply in all the PRs

oli (May 01 2019 at 07:16, on Zulip):

ah, now I remember the relevant discussion: What we want is not for CI to complain to you when you forget, but for CI to automatically rustfmt and add a commit. Otherwise it's a lot of noise for contributors

centril (May 01 2019 at 07:23, on Zulip):

@oli I thought we wanted CI to reject your PR on poor formatting

centril (May 01 2019 at 07:24, on Zulip):

and then to add a tool @bors fmt so you can add a commit that fixes it

centril (May 01 2019 at 07:25, on Zulip):

Maybe I should write an RFC?

davidtwco (May 01 2019 at 08:12, on Zulip):

I didn't think there was consensus on having a bot add a commit automatically vs tidy failing and a subcommand to format/bot to request a commit.

centril (May 01 2019 at 08:20, on Zulip):

Seems unclear what the consensus is then... best to find out the hard way

Last update: Nov 17 2019 at 07:55UTC