Skip to content

Commit

Permalink
ci: check doc comments with nightly format (#1857)
Browse files Browse the repository at this point in the history
  • Loading branch information
7596ff authored Sep 22, 2022
1 parent f85f1e5 commit 46eace0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,17 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@v1
with:
components: rustfmt
toolchain: nightly

- name: Add problem matchers
run: echo "::add-matcher::.github/rust.json"

- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Check code formatting
run: cargo fmt --all -- --check --unstable-features --config format_code_in_doc_comments=true

min-vers:
name: Minimal crate versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use twilight_model::id::{marker::ApplicationMarker, Id};
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// use std::env;
/// use twilight_http::{Client, request::AuditLogReason};
/// use twilight_http::{request::AuditLogReason, Client};
/// use twilight_model::id::Id;
///
/// let client = Client::new(env::var("DISCORD_TOKEN")?);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use twilight_model::{
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// use std::env;
/// use twilight_http::{Client, request::AuditLogReason};
/// use twilight_http::{request::AuditLogReason, Client};
/// use twilight_model::id::Id;
///
/// let client = Client::new(env::var("DISCORD_TOKEN")?);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use twilight_model::{
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// use std::env;
/// use twilight_http::{Client, request::AuditLogReason};
/// use twilight_http::{request::AuditLogReason, Client};
/// use twilight_model::id::Id;
///
/// let client = Client::new(env::var("DISCORD_TOKEN")?);
Expand Down
4 changes: 3 additions & 1 deletion twilight-model/src/channel/message/component/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ impl Component {
/// Type of component that this is.
///
/// ```
/// use twilight_model::channel::message::component::{Button, ButtonStyle, Component, ComponentType};
/// use twilight_model::channel::message::component::{
/// Button, ButtonStyle, Component, ComponentType,
/// };
///
/// let component = Component::Button(Button {
/// custom_id: None,
Expand Down

0 comments on commit 46eace0

Please sign in to comment.