Skip to content

Commit

Permalink
ci: autolint code with shfmt in addition to black?
Browse files Browse the repository at this point in the history
  • Loading branch information
alexAubin committed Sep 12, 2024
1 parent 2b53837 commit 7020a48
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 26 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/autoblack.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/autolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Check / auto apply Black

on:
push:
branches: [ "dev" ]

jobs:
autolint:
name: Check / auto apply black and shfmt
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
steps:
- uses: actions/checkout@v4

- name: Run Shfmt
uses: collin-miller/shfmt-action@v1
with:
# -i=4 # indent
# -kp # keep column alignment paddings
# -sr # redirect operators will be followed by a space
# -bn # binary ops like && and | may start a line
# -ci # switch cases will be indented
# -w # write to file instead of stdout
args: -i=4 -kp -sr -bn -ci -w helpers/helpers helpers/helpers.v*.d/* hooks/*
continue-on-error: true

- name: Check files using the black formatter
uses: psf/black@stable
with:
options: "."
continue-on-error: true

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit-message: ":art: Format Python code with Black, and Bash code with Shfmt"

0 comments on commit 7020a48

Please sign in to comment.