CuteChuanChuan opened a new pull request, #18542:
URL: https://github.com/apache/datafusion/pull/18542

   ## Which issue does this PR close?
   
   Closes #16915.
   
   ## Rationale for this change
   
   This PR adds CI enforcement to ensure all code examples in documentation 
comments are properly formatted to maintain consistent code formatting, 
including examples in doc comments.
   
   ## What changes are included in this PR?
   
   This PR adds a new CI check in the `check-fmt` job that:
   1. Installs the nightly Rust toolchain
   2. Runs `cargo +nightly fmt --all -- --check --config 
format_code_in_doc_comments=true`
   
   Note: `format_code_in_doc_comments` is currently an [unstable 
feature](https://github.com/rust-lang/rustfmt/issues/3348). 
   
   ## Relationship with #18541
   This PR depends on #18541, which formats the remaining doc comment code 
examples in the main branch (fe2469). The sequence is as follows to ensure the 
CI check won't fail due to pre-existing formatting issues:
   
   1. **First**: #18541 fixes all existing formatting issues in doc comments
   2. **Then**: This PR adds the CI check to prevent new unformatted code from 
being introduced
   
   ## Are these changes tested?
   The command is tested locally with:
   ```bash
   rustup toolchain install nightly
   cargo +nightly fmt --all -- --check --config format_code_in_doc_comments=true
   ```
   
   ## Are there any user-facing changes?
   No user-facing changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to