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

fix: cargo warnings of import item #10196

Merged
merged 4 commits into from
Apr 24, 2024
Merged

Conversation

waynexia
Copy link
Member

Which issue does this PR close?

Closes #.

Rationale for this change

I found there are many warnings in the project. It looks like we don't run "cargo check" for (a large number of) test modules.

The majority kinds are

  • duplicated import from super::* or xx::prelude::*
  • default imported items since rust edition 2021

What changes are included in this PR?

  • Fix the warnings
  • Deny unused_imports in Cargo.toml
  • Try to run check for all targets in workspace level.

Are these changes tested?

N/A

Are there any user-facing changes?

N/A

Signed-off-by: Ruihang Xia <[email protected]>
@github-actions github-actions bot added sql SQL Planner logical-expr Logical plan and expressions physical-expr Physical Expressions optimizer Optimizer rules core Core DataFusion crate labels Apr 23, 2024
@@ -77,7 +77,7 @@ jobs:
run: cargo check --all-targets --no-default-features -p datafusion-functions

- name: Check workspace in debug mode
run: cargo check
run: cargo check --all-targets --workspace
Copy link
Member Author

Choose a reason for hiding this comment

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

This should cover test modules

@@ -130,3 +130,6 @@ rpath = false
[workspace.lints.clippy]
# Detects large stack-allocated futures that may cause stack overflow crashes (see threshold in clippy.toml)
large_futures = "warn"

[workspace.lints.rust]
unused_imports = "deny"
Copy link
Member Author

Choose a reason for hiding this comment

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

Deny unused import warning. Unfortunately, cargo check doesn't support things like -D warning at present rust-lang/cargo#8424

Signed-off-by: Ruihang Xia <[email protected]>
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.

Thank you @waynexia -- looks like a great clean up to me

Screenshot 2024-04-23 at 1 49 37 PM 👏

@waynexia waynexia merged commit 4edbdd7 into apache:main Apr 24, 2024
25 checks passed
@waynexia waynexia deleted the fix-test-warnings branch April 24, 2024 06:32
ccciudatu pushed a commit to hstack/arrow-datafusion that referenced this pull request Apr 26, 2024
* fix: cargo warnings of import item

Signed-off-by: Ruihang Xia <[email protected]>

* deny unused imports

Signed-off-by: Ruihang Xia <[email protected]>

* allow util macro re-export

Signed-off-by: Ruihang Xia <[email protected]>

* lift windows target feature gate to mod level

Signed-off-by: Ruihang Xia <[email protected]>

---------

Signed-off-by: Ruihang Xia <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate logical-expr Logical plan and expressions optimizer Optimizer rules physical-expr Physical Expressions sql SQL Planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants