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

[Enhancement] CI: Run rustfmt when .rustfmt.toml was Edited; Fixes #38 #42

Merged
merged 2 commits into from
Jan 14, 2024
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
61 changes: 61 additions & 0 deletions .github/workflows/rustfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
######################## GNU General Public License 3.0 ########################
## ##
## Copyright (C) 2024 Kevin Matthes ##
## ##
## This program is free software: you can redistribute it and/or modify ##
## it under the terms of the GNU General Public License as published by ##
## the Free Software Foundation, either version 3 of the License, or ##
## (at your option) any later version. ##
## ##
## This program is distributed in the hope that it will be useful, ##
## but WITHOUT ANY WARRANTY; without even the implied warranty of ##
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ##
## GNU General Public License for more details. ##
## ##
## You should have received a copy of the GNU General Public License ##
## along with this program. If not, see <https://www.gnu.org/licenses/>. ##
## ##
################################################################################

################################################################################
##
## AUTHOR Kevin Matthes
## BRIEF Reformat the Rust source code.
## COPYRIGHT GPL-3.0
## DATE 2024
## FILE rustfmt.yml
## NOTE See `LICENSE' for full license.
## See `README.md' for project details.
##
################################################################################

name: rustfmt

on:
push:
branches-ignore:
- main
paths:
- .rustfmt.toml

permissions:
contents: write

jobs:
reformat:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0
ref: ${{ github.head_ref }}

- uses: fregante/setup-git-user@v2.0.1

- run: |
cargo fmt
git add .
git commit --allow-empty -m '[GitHub Actions] cargo fmt'
git push

################################################################################
8 changes: 8 additions & 0 deletions changelog.d/20240114_151513_GitHub_Actions_38.ron
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(
references: {},
changes: {
"Added": [
".github/workflows/rustfmt.yml; fixes #38",
],
},
)