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

Generated code is not formatted with nightly compiler #868

Open
PSeitz opened this issue Dec 17, 2021 · 10 comments
Open

Generated code is not formatted with nightly compiler #868

PSeitz opened this issue Dec 17, 2021 · 10 comments

Comments

@PSeitz
Copy link

PSeitz commented Dec 17, 2021

Version

pascal@pascal-G533QM ~/L/D/q/c/quickwit-proto (conf_sort)> cargo tree | grep tonic
└── tonic v0.5.2
└── tonic-build v0.5.2

Platform

Linux pascal-G533QM 5.12.0-051200-generic #202104252130 SMP Sun Apr 25 21:33:13 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Description

In our project quickwit https://github.com/quickwit-inc/quickwit, the code is not formatted or formatted differently when I run the build_script https://github.com/quickwit-inc/quickwit/blob/main/quickwit-proto/build.rs.

cd quickwit-proto;cargo build

These are the generated files on my machine:
cluster.txt
quickwit.txt

@davidpdrsn
Copy link
Member

tonic-build's rustfmt feature should format the code.

@PSeitz
Copy link
Author

PSeitz commented Dec 17, 2021

Can I check somehow why it doesn't?

@davidpdrsn
Copy link
Member

Read the code in tonic build 🤷‍♂️😂

Can you provide a reproduction script?

@PSeitz
Copy link
Author

PSeitz commented Dec 17, 2021

Can you provide a reproduction script?

No, it happens only on my machine :)

@davidpdrsn
Copy link
Member

Then I’m not sure what could be going on. Maybe something is wrong with your rustfmt installation 🤷‍♂️

@PSeitz
Copy link
Author

PSeitz commented Dec 20, 2021

The issue only occurs with the nightly compiler, stable works

@PSeitz PSeitz changed the title Generated code is not formatted Generated code is not formatted with nightly compiler Dec 21, 2021
@LucioFranco
Copy link
Member

Does your nightly toolchain have rustfmt installed?

@PSeitz
Copy link
Author

PSeitz commented Dec 31, 2021

Does your nightly toolchain have rustfmt installed?

Yes, e.g. this command completes cargo +nightly fmt --all -- --check

@LucioFranco
Copy link
Member

Do you use rustup override set nightly in the directory?

@PSeitz
Copy link
Author

PSeitz commented Jan 4, 2022

I have no overrides

rustup override list
     no overrides

Did you try to reproduce the issue?

formatting does not work (files changed)

git clone https://github.com/quickwit-inc/quickwit
cd quickwit;cd quickwit-proto;cargo +nightly build

formatting works (files unchanged)

git clone https://github.com/quickwit-inc/quickwit
cd quickwit;cd quickwit-proto;cargo +stable build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants