Skip to content
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

Remove rustfmt from travis builds #1487

Closed
mcarton opened this issue Jan 28, 2017 · 13 comments · Fixed by #1538
Closed

Remove rustfmt from travis builds #1487

mcarton opened this issue Jan 28, 2017 · 13 comments · Fixed by #1538
Labels
C-question Category: Questions good-first-issue These issues are a good way to get started with Clippy S-needs-discussion Status: Needs further discussion before merging or work can be started

Comments

@mcarton
Copy link
Member

mcarton commented Jan 28, 2017

I vote to remove rustfmt from travis.

I find it really annoying, blindly applying rustfmt suggestions does not make the code clearer in lots of instances and even often make it worst (recent example).
It also seems really hard to make rustfmt happy both locally and on travis (1, 2, 3).

@mcarton mcarton added S-needs-discussion Status: Needs further discussion before merging or work can be started good-first-issue These issues are a good way to get started with Clippy C-question Category: Questions labels Jan 28, 2017
@oli-obk
Copy link
Contributor

oli-obk commented Jan 28, 2017

we can set it up so that rustfmt is required to be run once a month. That way we won't diverge much and it doesn't influence day to day business.

@Manishearth
Copy link
Member

I'm okay with the suboptimal suggestions, since the vast majority of suggestions are good, and the suboptimal ones are subjective.

The local/travis thing is a version issue.

That way we won't diverge much

It tends to diverge quickly IME. We might have better experiences here though.

@killercup
Copy link
Member

I think the idea of running rustfmt on travis is good. But you should definitely pin it to a specific version to make it more deterministic.

Also, while you are at it, please consider using block ident for function arguments, which reduces line length as well as diff churn. rustfmt has fn_arg_indent = "Tabbed" but sadly it doesn't seem to change to current visual indented code in any way…

@llogiq
Copy link
Contributor

llogiq commented Jan 28, 2017

Perhaps running it (to inform rustfmt devs) without failing the build?

@oli-obk
Copy link
Contributor

oli-obk commented Jan 28, 2017

It's possible to set up travis targets that don't fail the build, but they won't show up red in the pr, just in travis.

@killercup
Copy link
Member

If it doesn't fail the build, nobody's gonna notice. Unless you manage to write a script that automatically comments on the PR with the rustfmt diff. (Just like the one I want for compiler warnings.)

@llogiq
Copy link
Contributor

llogiq commented Jan 28, 2017

True.

@Manishearth
Copy link
Member

Manishearth commented Jan 28, 2017 via email

@oli-obk
Copy link
Contributor

oli-obk commented Jan 30, 2017

Alternatively we set up a travis job that only does rustfmt checks and use something like https://github.com/wizeline/travieso#heroku , but I don't have a heroku or other server to host it on.

Or we wait until travis-ci/travis-tasks#78 is merged to automatically get one icon per github job.

Or we just remove the rustfmt checks and add a travis job on master commits that automatically runs rustfmt and pushes a commit to the master branch if rustfmt changed anything.

@oli-obk
Copy link
Contributor

oli-obk commented Feb 13, 2017

A great argument from @dtolnay against rustfmt as a blocker or even showing up in travis:

I don't think that would be valuable. The tradeoff is scaring away new contributors. If someone makes a PR, I would prefer that they remember it as a reasonable discussion about meaningful things, rather than as a struggle to satisfy a grumpy buildbot. Even if the overall build is green, seeing a red task can be anxiety-inducing and uncertain about whether you are responsible for fixing it. Instead, if the code looks mostly fine then I won't notice or care anyway, and somebody will run rustfmt every month or so and it takes 10 seconds to clean everything up so there isn't really anything to gain from enforcing it.

@oli-obk
Copy link
Contributor

oli-obk commented Feb 13, 2017

Although I feel like the same argument could be made for util/update_lints.py, it's not like it's very important for that list to be 100% up to date. We can make rustfmt and update_lints a prerequisite of version bumps instead.

@mcarton
Copy link
Member Author

mcarton commented Feb 13, 2017

👍 We've already had people complaining that they can't use a lint described in the README because it was not published yet.

@F001
Copy link
Contributor

F001 commented Feb 14, 2017

We can add a x.py script for this project just like rustc. Every building and documentation jobs can be done by this tool. Such as:

./x.py prepare     // format codes / update documentations etc. Everyone should run this command before PR
./x.py build       // build the project completely
./x.py test        // run tests
./x.py clean       // cleanup

I don't like several tools hidden in different folders.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-question Category: Questions good-first-issue These issues are a good way to get started with Clippy S-needs-discussion Status: Needs further discussion before merging or work can be started
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants