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

add Makefile targets for fix-whitespace #10376

Merged
merged 1 commit into from
Sep 29, 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
17 changes: 14 additions & 3 deletions .github/workflows/whitespace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,21 @@ on:

jobs:
whitespace:
defaults:
run:
shell: bash
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v4
- uses: andreasabel/fix-whitespace-action@v1
with:
verbose: true

- run: |
# no longer using the action because apparently we're supposed to use the Makefile here
wget -q https://github.com/agda/fix-whitespace/releases/download/v0.1/fix-whitespace-0.1-linux.binary
mkdir -p "$HOME/.local/bin"
mv fix-whitespace-0.1-linux.binary "$HOME/.local/bin/fix-whitespace"
chmod +x "$HOME/.local/bin/fix-whitespace"
echo "$HOME/.local/bin" >> $GITHUB_PATH

- run: make whitespace
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ the code base.

We use automated whitespace convention checking. Violations can be fixed by
running [fix-whitespace](https://hackage.haskell.org/package/fix-whitespace). If
you push a fix of a whitespace violation, please do so in a _separate commit_.
you push a fix of a whitespace violation, please do so in a _separate commit_. For convenience,
`make whitespace` will show violations and `make fix-whitespace` will fix them, if the
`fix-whitespace` utility is installed.

## Other Conventions

Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ style-commit: ## Run the code styler on the previous commit
@git diff --name-only HEAD $(COMMIT) Cabal Cabal-syntax cabal-install \
| grep '.hs$$' | xargs -P $(PROCS) -I {} fourmolu -q -i {}

.PHONY: whitespace
whitespace: ## Run fix-whitespace in check mode
fix-whitespace --check --verbose

.PHONY: fix-whitespace
fix-whitespace: ## Run fix-whitespace in fix mode
fix-whitespace --verbose

# source generation: SPDX

SPDX_LICENSE_HS:=Cabal-syntax/src/Distribution/SPDX/LicenseId.hs
Expand Down
Loading