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

Rust 2018 and code formatting #759

Merged
merged 16 commits into from May 13, 2019
Merged

Rust 2018 and code formatting #759

merged 16 commits into from May 13, 2019

Conversation

@heftig
Copy link
Contributor

@heftig heftig commented May 11, 2019

  • Port the code to Rust 2018. The output is untouched and still Rust 2015.
  • Format all the code! Used rustfmt nightly with merge_imports = true. This does not conflict with stable rustfmt.
@sdroege
Copy link
Member

@sdroege sdroege commented May 11, 2019

👍 after fixing the merge conflicts. Thanks!

@heftig
Copy link
Contributor Author

@heftig heftig commented May 11, 2019

Actually, found a few more things to do... one moment.

@heftig heftig force-pushed the 2018+fmt branch 2 times, most recently from d490514 to c9e0873 May 11, 2019
@@ -30,3 +30,4 @@ build = "build.rs"
links = "atk"
name = "atk-sys"
version = "0.2.0"
edition = "2018"
Copy link
Member

@EPashkin EPashkin May 11, 2019

Only in root Cargo.toml please

@EPashkin
Copy link
Member

@EPashkin EPashkin commented May 11, 2019

@GuillaumeGomez What you think about this PR?

@heftig Thanks.
I only see 2 problems: wrongly added edition = "2018" to old generated code,
and mismatched usage of use: sometimes there 2 or more sections, separated by empty lines.
Maybe better combine and reformat it?
I don't sure, wherever it is better put "external uses" in separate section or not.

PS.
Seems first problem is actually not problem as travis passed.

@heftig
Copy link
Contributor Author

@heftig heftig commented May 11, 2019

mismatched usage of use: sometimes there 2 or more sections, separated by empty lines.
Maybe better combine and reformat it?
I don't sure, wherever it is better put "external uses" in separate section or not.

Whatever you prefer. rustfmt doesn't (yet) reorder between sections. In the "Manually clean up imports" commit I reordered some manually to have external imports first, then internal ones, because this scheme was already in use in many files.

PS.
Seems first problem is actually not problem as travis passed.

I just removed the edition from the sub-projects, as requested. Should I undo this again?

@EPashkin
Copy link
Member

@EPashkin EPashkin commented May 11, 2019

Thanks, I prefer edition only in one file, so no undo needed.
This PR is changing a lot. can you make only one use section too?

@heftig heftig force-pushed the 2018+fmt branch 2 times, most recently from f3d7a3d to ba800f3 May 11, 2019
@heftig
Copy link
Contributor Author

@heftig heftig commented May 11, 2019

Assuming AppVeyor passes, this should be done, now.

@GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented May 11, 2019

A few PRs on gir are pending and rebasing them on this one would be a nightmare. Once things are settled down, it'll make sense but beforehand it'd very complicated.

@sdroege
Copy link
Member

@sdroege sdroege commented May 12, 2019

Can we get this in then? :)

@GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented May 12, 2019

Now that my PR has been merged, yes for sure. :)

@heftig
Copy link
Contributor Author

@heftig heftig commented May 12, 2019

Does it need another rebase? I can do that once I'm on the train.

@EPashkin
Copy link
Member

@EPashkin EPashkin commented May 12, 2019

@heftig Yes, please.
And fix or remove checks in apveyor.

warning: very complex type used. Consider factoring parts into `type` definitions
@heftig heftig force-pushed the 2018+fmt branch 2 times, most recently from cf770d0 to 3505ee1 May 12, 2019
@heftig
Copy link
Contributor Author

@heftig heftig commented May 12, 2019

Added two new commits to deal with new warnings on master.

  • GStatus: Rename Generate_Builders
  • Reduce type complexity for group_by_user_data

@heftig heftig force-pushed the 2018+fmt branch 2 times, most recently from a0b603a to 933ad6d May 12, 2019
Copy link
Member

@EPashkin EPashkin left a comment

@heftig Thanks
Only last nits about CI

appveyor.yml Outdated
- rustc -Vv
- cargo -Vv
- pacman --noconfirm -S mingw-w64-%ARCH%-gtk3 mingw-w64-%ARCH%-libgit2 mingw-w64-%ARCH%-libsecret

build_script:
- git clone -q https://github.com/gtk-rs/gir-files tests/gir-files
- IF "%RUST%" == "stable" cargo clippy --all --release
- IF "%RUST%" == "stable" cargo check --all --release
Copy link
Member

@EPashkin EPashkin May 13, 2019

apveyor check only stables, so if don't needed,
You sure that cargo check can show something new after cargo clippy ?
Why is --all used, gir don't have workspaces.

Copy link
Contributor Author

@heftig heftig May 13, 2019

No, I'm not sure. --all is from copying the invocations from somewhere else.

.travis.yml Outdated Show resolved Hide resolved
Run clippy first to ensure the gir_version module is present. Otherwise
formatting would fail.
@EPashkin
Copy link
Member

@EPashkin EPashkin commented May 13, 2019

cc @GuillaumeGomez, @sdroege just in case

Copy link
Member

@GuillaumeGomez GuillaumeGomez left a comment

Looks good to me!

@sdroege
Copy link
Member

@sdroege sdroege commented May 13, 2019

👍

@sdroege
Copy link
Member

@sdroege sdroege commented May 13, 2019

Next step: all our crates :)

@EPashkin
Copy link
Member

@EPashkin EPashkin commented May 13, 2019

@heftig Thanks

@EPashkin EPashkin merged commit f10b0e5 into gtk-rs:master May 13, 2019
2 checks passed
@heftig heftig mentioned this pull request Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants