Skip to content

Commit

Permalink
Ensure cargo fmt Is executed in CI #248 (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyu08 authored Apr 2, 2024
1 parent 3c5e264 commit 157f8d1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Format check

on:
push:
branches: [ "main" ]
pull_request:
paths:
- 'src/**.rs'
- Cargo.toml
- Cargo.lock

env:
CARGO_TERM_COLOR: always

jobs:
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Check formatting
run: |
make fmt
1 change: 0 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ jobs:

- name: Lint
run: |
cargo fmt
make check
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUST_BACKTRACE=full
ci: # Checks same as CI
@make test-ci; \
make check; \
make fmt; \
make spell-check

.PHONY: tools
Expand Down Expand Up @@ -60,6 +61,10 @@ run:
build:
@cargo build

.PHONY: fmt
fmt:
@cargo fmt -- --check

.PHONY: check
check:
@cargo clippy -- -D warnings
Expand Down

0 comments on commit 157f8d1

Please sign in to comment.