diff --git a/.cargo/config.toml b/.cargo/config.toml index 0d373727..94136187 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -36,10 +36,9 @@ rustflags = [ "-Wclippy::unnecessary_cast", # Incomplete code - "-Wmissing_docs", "-Wclippy::dbg_macro", "-Wclippy::todo", - + # Manual debugging output. # Use tracing::trace!() or tracing::debug!() instead. "-Wclippy::print_stdout", @@ -49,12 +48,18 @@ rustflags = [ # Code styles we want to accept "-Aclippy::try_err", - # Links in public docs can point to private items. - "-Arustdoc::private_intra_doc_links", - # Panics "-Wclippy::fallible_impl_from", "-Wclippy::unwrap_in_result", + + # Documentation + "-Wmissing_docs", + + # These rustdoc -A and -W settings must be the same as the RUSTDOCFLAGS in: + # https://github.com/ZcashFoundation/zebra/blob/main/.github/workflows/lint.yml#L152 + + # Links in public docs can point to private items. + "-Arustdoc::private_intra_doc_links", # TODOs: # `cargo fix` might help do these fixes, diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8cbdbbc4..e7810947 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -143,6 +143,13 @@ jobs: runs-on: ubuntu-latest needs: changed-files if: ${{ needs.changed-files.outputs.rust == 'true' }} + # cargo doc doesn't support '-- -D warnings', so we have to add it here + # https://github.com/rust-lang/cargo/issues/8424#issuecomment-774662296 + # + # These -A and -W settings must be the same as the rustdoc settings in: + # https://github.com/ZcashFoundation/zebra/blob/main/.cargo/config.toml#L53 + env: + RUSTDOCFLAGS: -D warnings -A rustdoc::private_intra_doc_links steps: - uses: actions/checkout@v3.1.0