exercism / exercism/configlet

ci: consider checking the formatting of scripts

Open
#641 0 comments 0 reactions 0 assignees View on GitHub
kind: ci
Dominant language
Nim
Stars
23
Forks
17
Avg merge
13h 57m
Merged PRs (30d)
1

Description

Maybe something like:

```shell
shfmt --diff -i 2 -ci -sr -kp
```

```console
$ shfmt --version
3.5.1
$ shfmt --help
usage: shfmt [flags] [path ...]

shfmt formats shell programs. If the only argument is a dash ('-') or no
arguments are given, standard input will be used. If a given path is a
directory, all shell scripts found under that directory will be used.

--version show version and exit

-l, --list list files whose formatting differs from shfmt's
-w, --write write result to file instead of stdout
-d, --diff error with a diff when the formatting differs
-s, --simplify simplify the code
-mn, --minify minify the code to reduce its size (implies -s)

Parser options:

-ln, --language-dialect str bash/posix/mksh/bats, default "auto"
-p, --posix shorthand for -ln=posix
--filename str provide a name for the standard input file

Printer options:

-i, --indent uint 0 for tabs (default), >0 for number of spaces
-bn, --binary-next-line binary ops like && and | may start a line
-ci, --case-indent switch cases will be indented
-sr, --space-redirects redirect operators will be followed by a space
-kp, --keep-padding keep column alignment paddings
-fn, --func-next-line function opening braces are placed on a separate line

Utilities:

-f, --find recursively find all shell files and print the paths
--tojson print syntax tree to stdout as a typed JSON

For more information, see 'man shfmt' and https://github.com/mvdan/sh.
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the repository's CI configuration and shell scripts, then check how shfmt 3.5.1 can be invoked with the proposed options. Confirm which scripts should be checked and whether the CI job reports formatting differences. Done means the selected scripts are covered by an automated formatting check.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
ci-cd
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.