Skip to content

Conversation

samuelcolvin
Copy link
Contributor

Rationale for this change

It's very frustrating when working on datafusion that unused imports cause scripts and tests to fail at build time, and not run.

Also, while looking in to this, it seems the pre-commit.sh script wasn't failing when clippy failed.

This doesn't affect CI where unused imports will still cause failure I believe.

What changes are included in this PR?

  • remove unused_imports = "deny" from the root Cargo.toml, so the default behaviour of warning occurs
  • make pre-commit.sh fail if clippy fails

Are these changes tested?

Manually, yes.

Are there any user-facing changes?

No.

@samuelcolvin samuelcolvin changed the title No error unused imports Warn instead of error for unused imports Sep 23, 2024
@samuelcolvin
Copy link
Contributor Author

See samuelcolvin#2 - confirming that CI still fails on unused imports.

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 @samuelcolvin

I double checked that the actual CI calls rust_clippy.sh

run: ci/scripts/rust_clippy.sh

And then that rust_clippy will error on warnings -D warnings

cargo clippy --all-targets --workspace --features avro,pyarrow -- -D warnings

@alamb alamb added the development-process Related to development process of DataFusion label Sep 23, 2024
@alamb alamb merged commit 99b5673 into apache:main Sep 23, 2024
27 checks passed
bgjackma pushed a commit to bgjackma/datafusion that referenced this pull request Sep 25, 2024
* warn not error on unused imports

* pre-commit error on clippy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

development-process Related to development process of DataFusion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants