Skip to content

Conversation

@etseidl
Copy link
Contributor

@etseidl etseidl commented Aug 29, 2024

Which issue does this PR close?

Closes #6179.

Rationale for this change

Modules declared in a macro are skipped by rustfmt. This only appears to be an issue in the parquet crate.

What changes are included in this PR?

Runs rustfmt for all rust source files under parquet in the CI workflow. Also updates formatting instructions in CONTRIBUTING.md.

Are there any user-facing changes?

No

@alamb
Copy link
Contributor

alamb commented Aug 31, 2024

Thanks @etseidl

The check certainly seems to find the problem: https://github.com/apache/arrow-rs/actions/runs/10619078161/job/29435831298?pr=6328

The only other thing I think is important here is to provide instructions (as comments) about how to fix the CI check if it fails. E.g. "if this test fails, run cargo fmt ..... and check in the result" kind

@etseidl
Copy link
Contributor Author

etseidl commented Aug 31, 2024

The only other thing I think is important here is to provide instructions (as comments) about how to fix the CI check if it fails. E.g. "if this test fails, run cargo fmt ..... and check in the result" kind

As a comment in rust.yml? Can do. I was also thinking some words in the formatting section of CONTRIBUTING.md would be helpful.

@github-actions github-actions bot added the parquet Changes to the parquet crate label Aug 31, 2024
@etseidl etseidl marked this pull request as ready for review August 31, 2024 20:36
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me -- thank you @etseidl

IF we get annoyed the formatting isn't working / CI fails too often we can figure out some way to get these files formatted directly via cargo fmt (e.g. change the macro incantantations etc)

- name: Format arrow
run: cargo fmt --all -- --check
- name: Format parquet
# Many modules in parquet are skipped, so check parquet separately. If this check fails, run:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 thank you

The only other thing I think is important here is to provide instructions (as comments) about how to fix the CI check if it fails. E.g. "if this test fails, run cargo fmt ..... and check in the result" kind

As a comment in rust.yml? Can do. I was also thinking some words in the formatting section of CONTRIBUTING.md would be helpful.

Yes, the reason I think it is useful to include this information is so that if the CI test fails, the developer can just look at the CI failure report on github (rather than hunting around in the docs) and know how to fix it.

THis looks good to me -- thank you

https://github.com/apache/arrow-rs/blob/ffd216d57469a33303c0d2ec9b974fd25cc0e0f9/.github/workflows/arrow_flight.yml#L75C37-L76C70

@alamb
Copy link
Contributor

alamb commented Sep 9, 2024

🚀

@alamb alamb merged commit 25e1969 into apache:master Sep 9, 2024
@alamb
Copy link
Contributor

alamb commented Sep 9, 2024

Thanks again @etseidl -- sorry for the delay in merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is cargo fmt no longer working properly in parquet crate

2 participants