apache / apache/gravitino

[Improvement] Add shfmt to lint shell script

Open
#6,862 0 comments 0 reactions 1 assignee Claimed by @unknowntpo View on GitHub
improvement
Dominant language
Java
Stars
3.2k
Forks
935
Avg merge
1d 16h
Merged PRs (30d)
298

Description

### What would you like to be improved?

Currently, shell scripts are not lint by linter, if contributors have different settings at their IDEs, the indentation may be different.

### How should we improve?

Use `shfmt` in `.github/workflows/build.yml` to lint the shell scripts.

```
- name: Install shfmt
run: |
curl -sSLo shfmt https://github.com/mvdan/sh/releases/download/v3.8.0/shfmt_v3.8.0_linux_amd64 &&
chmod +x shfmt &&
sudo mv shfmt /usr/local/bin/shfmt

- name: Lint Shell Scripts
run: |
find . -name '*.sh' -print0 | xargs -0 shfmt -d
```

@xunliu @danhuawang

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.