Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: check doc comments with nightly format #1857

Merged
merged 6 commits into from
Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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