-
Notifications
You must be signed in to change notification settings - Fork 288
[ci] check formatting #64
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
Conversation
I guess this PR should include a run of |
@BurntSushi |
So it seems that rustfmt is also failing to install. @alexcrichton does this happen often (that clippy and rustfmt fail to install on nightly)? Is there a better way to deal with this? |
b4040e6
to
a94d725
Compare
@BurntSushi what do you think about the way it's done now? I could do the same for clippy. |
I guess technically that's OK, but there is a fundamental tension here if we're trying to use code that doesn't reliably build:
IMO, if we're going to put stuff into CI, then it needs to be reliable. I would definitely be curious to hear @alexcrichton's thoughts on the matter! Perhaps there is another way. |
I also want to hear what @alexcrichton has to say. In particular, even if clippy and rustfmt work on stable one day, will we be able to use them? This library uses unstable Rust features by design. |
a5d9155
to
92c03e7
Compare
It seems that |
740d656
to
b92e539
Compare
So I've added a commit that reformats the whole library so that you guys can check it out. I can live with most of it, but some of the |
Ug. Yeah. I don't like that at all. I could probably deal with it if we only ever worked with 128 bit vectors, but this formatting style is going to become unbearable with 256 bit and 512 bit vectors. We really need to be able to control line breaking for those. |
Clang format has a very convenient way to disable formatting in these cases: // clang-format off
... do whatever you want ...
// clang-format on I'll try to do the same in these places. |
4889302
to
2d518d9
Compare
@BurntSushi so i've fixed all those places, there is a |
Yeah unfortunately I don't have a lot of experience here in terms of running rustfmt on CI. From what I hear though the output is still being tweaked over time so an update of rustfmt one day could otherwise break the CI here. In terms of style I've personally sort of given up at this point and am just willing to accept whatever rustfmt does. I won't like some things but I'm pretty sure I'll like others, and having it all happen automatically tends to make it easier to just get used to than try to work around. I'm sort of up in the air about whether to enable it or not here. I could go either way! I don't have a particularly strong preference. |
I'm willing to give this a try, with |
232712a
to
fbe0cf6
Compare
@alexcrichton could you check what is going on here? I have installed the latest rustup and the latest rustfmt-nightly. Doing cargo fmt on my machine produces a different formatting than in the build bot (which should also be using the same rustfmt version). |
Also one normal build is failing with |
Duh... there were new merges to master while I was working on this, which introduced formatting differences. All should be green now :) Keeping this branch in sync with master is a PITA because every commit to master makes this branch fail. |
.travis.yml
Outdated
|
||
script: | ||
- cargo generate-lockfile | ||
- ci/run-docker.sh $TARGET | ||
- if [[ "${RUSTFMT}" == "" ]]; then ci/run-docker.sh $TARGET; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of this conditional you should be able to just specify script:
above, right? (in the include:
matrix)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? I added the conditional to avoid running the docker tests in the build that just checks formatting. I don't like this much either (in particular if we add clippy on top).
Maybe a better way could be to move this to a ci/run.sh
script that reads the environment variables (e.g. RUSTFMT
, CLIPPY
, etc) and does the right thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyways since basically every commit breaks this one, and updating it sometimes requires manual edits, I'd rather merge it first, and improve the build scripts later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you can avoid this if/else statement if you add a script:
directive to the env:
that you added in this same file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think i've fixed this here and in the enable_clippy PR. The build is green except for i586, is that failure "normal" ?
026fe33
to
729173e
Compare
This is all green, if we want to tune the formatting, we should do so before merging this. |
@BurntSushi thoughts on this and the clippy branches? |
@alexcrichton @BurntSushi what should I do about this and the clippy commit ? |
@gnzlbg I'm ok with both, but I figured @BurntSushi should sign off as well |
I'm OK too. Looks like this PR needs to be updated yet again though... Sorry :-( |
It will proceed to get this into a mergeable state (takes 15min), please don't merge anything else in the mean time. |
794f76a
to
cac311c
Compare
@BurntSushi so i've updated this and rebased, can we merge this? |
@BurntSushi seems like the osx build stalled but all should be green here. |
No description provided.