Skip to content

Commit 451d3b9

Browse files
committed
Enforce rustfmt in CI.
1 parent 8252d63 commit 451d3b9

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ env:
99
AWS_ACCESS_KEY_ID: AKIA46X5W6CZEAQSMRH7
1010

1111
jobs:
12+
rustfmt:
13+
name: Rustfmt
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@master
17+
- name: Install Rust
18+
run: rustup update stable && rustup default stable && rustup component add rustfmt
19+
- run: cargo fmt --all --check
20+
1221
ci:
1322
name: CI
1423
runs-on: ubuntu-latest

parser/src/command.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ impl<'a> Command<'a> {
209209

210210
#[test]
211211
fn errors_outside_command_are_fine() {
212-
let input =
213-
"haha\" unterminated quotes @bot labels +bug. Terminating after the command";
212+
let input = "haha\" unterminated quotes @bot labels +bug. Terminating after the command";
214213
let mut input = Input::new(input, vec!["bot"]);
215214
assert!(input.next().unwrap().is_ok());
216215
}

src/handlers/autolabel.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ pub(super) async fn handle_input(
130130
Err(e) => {
131131
use crate::github::UnknownLabels;
132132
if let Some(err @ UnknownLabels { .. }) = e.downcast_ref() {
133-
event.issue.post_comment(&ctx.github, &err.to_string()).await.context("failed to post missing label comment")?;
133+
event
134+
.issue
135+
.post_comment(&ctx.github, &err.to_string())
136+
.await
137+
.context("failed to post missing label comment")?;
134138
return Ok(());
135139
}
136140
return Err(e);

src/handlers/note.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,7 @@ pub(super) async fn handle_command(
141141
author,
142142
};
143143
log::debug!("New Note Entry: {:#?}", new_entry);
144-
current
145-
.entries_by_url
146-
.insert(comment_url, new_entry);
144+
current.entries_by_url.insert(comment_url, new_entry);
147145
log::debug!("Entries by URL: {:#?}", current.entries_by_url);
148146
}
149147
}

src/handlers/review_submitted.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ pub(crate) async fn handle(
77
config: &ReviewSubmittedConfig,
88
) -> anyhow::Result<()> {
99
if let Event::IssueComment(
10-
event
11-
@
12-
IssueCommentEvent {
10+
event @ IssueCommentEvent {
1311
action: IssueCommentAction::Created,
1412
issue: Issue {
1513
pull_request: Some(_),

0 commit comments

Comments
 (0)