ci: use Ubuntu shfmt shell formatter - #2583
Open
MikeMcC399 wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Please review, as it replaces your special Docker image for checking shell scripts and uses instead the standard package from Ubuntu. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
peterdavehello/shfmt:2.6.3inshfmt.yml#2555Description
Replace custom Docker image peterdavehello/shfmt:2.6.3 in .github/workflows/shfmt.yml with Ubuntu package shfmt for shell script format linting.
Use shfmt -d for read-only
--difflinting in CI.Motivation and Context
peterdavehello/shfmt:2.6.3in .github/workflows/shfmt.yml was published in Jan 2019 and is outdated.Ubuntu offers the package shfmt which relieves the need for a specially built Docker image to perform shell script linting in CI. It is also available in Debian. See https://github.com/mvdan/sh.
Testing Details
Locally in Ubuntu 24.04.4 LTS, execute:
sudo apt-get update sudo apt-get install -y shfmt shfmt -sr -i 2 -l -w -ci -d .and confirm no error reported.
Check for success of job
shfmtin workflow .github/workflows/shfmt.ymlTypes of changes
Checklist