[GH-ISSUE #132] Apply rustfmt to librespot-core and enforce it on travis #104

Closed
opened 2026-02-27 19:28:51 +03:00 by kerem · 7 comments
Owner

Originally created by @plietar on GitHub (Feb 8, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/132

From what I've heard rustfmt is good enough now for this to be possible.
In most places librespot already uses the standard style, so the initial diff shouldn't be that bad.

Originally created by @plietar on GitHub (Feb 8, 2018). Original GitHub issue: https://github.com/librespot-org/librespot/issues/132 From what I've heard rustfmt is good enough now for this to be possible. In most places librespot already uses the standard style, so the initial diff shouldn't be that bad.
kerem 2026-02-27 19:28:51 +03:00
Author
Owner

@sashahilton00 commented on GitHub (Feb 10, 2018):

Just had a look at rustfmt, and it looks as though it's good to go on beta and nightly builds, and getting there on rust 1.24.0. Do we think the requirements for rust => 1.24.0 are worth it for adding rustfmt to the project?

<!-- gh-comment-id:364611979 --> @sashahilton00 commented on GitHub (Feb 10, 2018): Just had a look at rustfmt, and it looks as though it's good to go on beta and nightly builds, and getting there on rust 1.24.0. Do we think the requirements for rust => 1.24.0 are worth it for adding rustfmt to the project?
Author
Owner

@plietar commented on GitHub (Feb 11, 2018):

@sashahilton00 Contributors would need to have nightly locally so they can run rustfmt, but people who are just building don't need anything.

<!-- gh-comment-id:364792203 --> @plietar commented on GitHub (Feb 11, 2018): @sashahilton00 Contributors would need to have nightly locally so they can run rustfmt, but people who are just building don't need anything.
Author
Owner

@sashahilton00 commented on GitHub (Feb 11, 2018):

Ok, could we perhaps add a brief note about contributors needing mightly, what rustfmt is, and what contributors need to run to the wiki? I can look at the website and work it out, but I feel like those who are just looking to help here and there probably aren't going to want to learn all about it, but rather have a brief overview of what it does, and what commands they need to run before committing.

<!-- gh-comment-id:364794342 --> @sashahilton00 commented on GitHub (Feb 11, 2018): Ok, could we perhaps add a brief note about contributors needing mightly, what rustfmt is, and what contributors need to run to the wiki? I can look at the website and work it out, but I feel like those who are just looking to help here and there probably aren't going to want to learn all about it, but rather have a brief overview of what it does, and what commands they need to run before committing.
Author
Owner

@awiouy commented on GitHub (Feb 11, 2018):

To use rustfmt:
Use atom and run rustfmt from atom as described here.

<!-- gh-comment-id:364795610 --> @awiouy commented on GitHub (Feb 11, 2018): To use rustfmt: Use [atom](https://atom.io/) and run rustfmt from atom as described [here](https://github.com/rust-lang-nursery/rustfmt/blob/master/atom.md).
Author
Owner

@kingosticks commented on GitHub (Feb 11, 2018):

It'd be helpful to have a general note for those that don't use atom.

<!-- gh-comment-id:364795839 --> @kingosticks commented on GitHub (Feb 11, 2018): It'd be helpful to have a general note for those that don't use atom.
Author
Owner

@sashahilton00 commented on GitHub (Feb 11, 2018):

Hmmm, I'm still hesitant about this; although Atom is popular (I use it as well), I'm not sure our solution to adding rustfmt and enforcing it on travis should be 'use this IDE or go hunting around the web for some other instructions. Is there no way to execute rustfmt on the cli to show a list of changes that should be made?

<!-- gh-comment-id:364795868 --> @sashahilton00 commented on GitHub (Feb 11, 2018): Hmmm, I'm still hesitant about this; although Atom is popular (I use it as well), I'm not sure our solution to adding rustfmt and enforcing it on travis should be 'use this IDE or go hunting around the web for some other instructions. Is there no way to execute rustfmt on the cli to show a list of changes that should be made?
Author
Owner

@ComlOnline commented on GitHub (Feb 14, 2018):

There is a suggestion to use nightly in the wiki, but something about how to use rustfmt would be handy.

I use VS-Code and it has an addon for rustfmt as well as a bunch of others I've found after a google (vim, emacs and Sublime)

As for running from command line have a look here.
But be warned the default mode is overwrite, see here for more modes.

EDIT: There is even a bit about editors

<!-- gh-comment-id:365498721 --> @ComlOnline commented on GitHub (Feb 14, 2018): There is a suggestion to use nightly in the [wiki](https://github.com/librespot-org/librespot/wiki/Development), but something about how to use rustfmt would be handy. I use VS-Code and it has an addon for rustfmt as well as a bunch of others I've found after a google (vim, emacs and Sublime) As for running from command line have a look [here](https://github.com/rust-lang-nursery/rustfmt#installation). But be warned the default mode is overwrite, see [here](https://github.com/rust-lang-nursery/rustfmt#running) for more modes. EDIT: There is even a [bit](https://github.com/rust-lang-nursery/rustfmt#running-rustfmt-from-your-editor) about editors
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#104
No description provided.