smithy-rs icon indicating copy to clipboard operation
smithy-rs copied to clipboard

Deny warnings in generated crates

Open david-perez opened this issue 2 years ago • 2 comments
trafficstars

We already --deny warnings in:

  • integration tests (crates generated by the codegen-{core,client,server}-test Gradle subprojects),
  • {client,server}IntegrationTests; and
  • RustWriter.compileAndTest, via the RUSTFLAGS we bake in the CI Docker image (note though that we should delete usages of RustWriter.compileAndTest https://github.com/smithy-lang/smithy-rs/issues/3193).

However, we do not deny warnings in TestWriterDelegator.compileAndTest; we generate crates with tests that have warnings.

It seems worthwhile to modify the tests so that they don't generate warnings to be consistent across the board. If a test can't be modified so as not to emit warnings, that specific test should opt-in into allowing warnings.

david-perez avatar Nov 14 '23 15:11 david-perez

For the record, as of writing (cfd89422e639f53b380f8f99641df6792f7848d1), there's 210 tests in the server that fail to compile if we --deny warnings. failing-tests.txt

david-perez avatar Dec 21 '23 11:12 david-perez

We also generate crates with doc warnings (mostly broken links), but CI doesn't fail, despite us baking in RUSTDOCFLAGS="-D warnings" in the Docker image, because we clear RUSTDOCFLAGS in CodegenTestCommon.kt.

david-perez avatar Jun 04 '24 14:06 david-perez