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 fix-whitespace #38

Merged
merged 2 commits into from
May 21, 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
13 changes: 13 additions & 0 deletions .github/workflows/whitespace.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: whitespace

on:
push:
pull_request:

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: andreasabel/fix-whitespace-action@v1
4 changes: 2 additions & 2 deletions ALTERNATIVES.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ ensures correct versions in the freeze file.

```
> stack2cabal --help
Usage: stack2cabal [-f|--file STACK_YAML] [-o|--output-file CABAL_PROJECT]
[--no-inspect-remotes] [--no-pin-ghc] [--no-sort-repos]
Usage: stack2cabal [-f|--file STACK_YAML] [-o|--output-file CABAL_PROJECT]
[--no-inspect-remotes] [--no-pin-ghc] [--no-sort-repos]
[--no-run-hpack] [-p|--pin-hackage-index FUZZY_DATE]

Available options:
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

3 directories, 8 files

$ cat project-dhall/pkgs/all-in-one.dhall
$ cat project-dhall/pkgs/all-in-one.dhall
-- NOTE: Using an empty list should trigger warnings like the following:
--
-- $ stack build
Expand All @@ -60,7 +60,7 @@
-- There is no <pkgname>.cabal package file or cabal.project file. To build
-- packages locally you need at minimum a <pkgname>.cabal file. You can use 'cabal
-- init' to create one.
--
--
-- For non-trivial projects you will also want a cabal.project file in the root
-- directory of your project. This file lists the packages in your project and all
-- other build configuration. See the Cabal user guide for full details.
Expand All @@ -71,4 +71,4 @@
```

### 1.0.0
* First release
* First release
2 changes: 1 addition & 1 deletion HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ $ ./pkgs-sorted.hs
, "./docs/"
, "./testing/"
]
```
```
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,22 +365,22 @@ UPDO_URL := ${HACKAGE}/updo-${UPDO_VERSION}/updo-${UPDO_VERSION}.tar.gz

```make
updo/Makefile:
rm -rf updo
curl -sSL ${UPDO_URL} | tar -xz
mv updo-* updo
chmod +x $$(grep -RIl '^#!' updo)
rm -rf updo
curl -sSL ${UPDO_URL} | tar -xz
mv updo-* updo
chmod +x $$(grep -RIl '^#!' updo)
```

2. When opting to install the included executables:

```make
updo/Makefile:
rm -rf updo
curl -sSL ${UPDO_URL} | tar -xz
cd updo-${UPDO_VERSION}
stack install
cd -
mv updo-* updo
rm -rf updo
curl -sSL ${UPDO_URL} | tar -xz
cd updo-${UPDO_VERSION}
stack install
cd -
mv updo-* updo
```

Both `cabal get` and `stack unpack` can also unpack package sources from
Expand All @@ -397,19 +397,19 @@ UPDO_VERSION ?= 4a8359f4e5d8cad61f35bea9d0a8f04477829ca1
UPDO_URL := https://github.com/cabalism/updo/archive/${UPDO_VERSION}.tar.gz

updo/Makefile:
rm -rf updo
curl -sSL ${UPDO_URL} | tar -xz
mv updo-* updo
chmod +x $$(grep -RIl '^#!' updo)
rm -rf updo
curl -sSL ${UPDO_URL} | tar -xz
mv updo-* updo
chmod +x $$(grep -RIl '^#!' updo)
```

2. From a branch:

```make
updo/Makefile:
rm -rf updo
git clone --depth=1 --branch main git@github.com:cabalism/updo
chmod +x $$(grep -RIl '^#!' updo)
rm -rf updo
git clone --depth=1 --branch main git@github.com:cabalism/updo
chmod +x $$(grep -RIl '^#!' updo)
```

# Make Targets
Expand Down Expand Up @@ -542,7 +542,7 @@ SHA256MAP_VIA_PYTHON ?= false
# overriding the recipe for this target.
ifeq ($(SHA256MAP_VIA_PYTHON), true)
ghc-$(GHC_VERSION).sha256map.nix: stack.yaml
updo/project-nix/sha256map.py <$^ >$@
updo/project-nix/sha256map.py <$^ >$@
endif
```

Expand Down
2 changes: 1 addition & 1 deletion TEMPLATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Available options:
--file FILE Read expression from a file instead of standard input
--output FILE Write result to a file instead of standard output
-h,--help Show this help text
```
```
12 changes: 6 additions & 6 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Assuming this layout of make files in updo and at the root of your project.
We'll need some versions, something like:

```
$ cat project-versions.mk
$ cat project-versions.mk
# Versions of GHC and stackage resolver, the ones we're on and the next ones
# we're upgrading to.
GHC_VERSION := 8.10.7
Expand All @@ -40,7 +40,7 @@ include project-versions.mk
include updo/Makefile

project-nix/ghc-%/sha256map.nix: ghc-%.sha256map.nix
mkdir -p $(@D) && cp $^ $@
mkdir -p $(@D) && cp $^ $@

.PHONY: all
all: \
Expand Down Expand Up @@ -70,9 +70,9 @@ include updo/alternatives/yaml2stack/Makefile
# overriding the recipe for this target.
ifeq ($(SHA256MAP_VIA_PYTHON), true)
ghc-$(GHC_VERSION).sha256map.nix: stack.yaml
updo/project-nix/sha256map.py <$^ >$@
updo/project-nix/sha256map.py <$^ >$@
ghc-$(GHC_UPGRADE).sha256map.nix: stack.yaml
updo/project-nix/sha256map.py <$^ >$@
updo/project-nix/sha256map.py <$^ >$@
endif

.DEFAULT_GOAL := all
Expand Down Expand Up @@ -149,7 +149,7 @@ cabal clean, this script will need to download dependencies.

* [ ] Can it do that without polluting the generated file with status updates from cabal saying
that it has downloaded this or that dependency[^silent-script]?

[^silent-script]: The Haskell script must run silently for this to work.

```
Expand Down Expand Up @@ -182,4 +182,4 @@ updo/project-dhall/pkgs-sorted.hs > .updo/pkgs-sorted.dhall

- `ghc-x.y.z.dhall2yaml2stack.yaml`
- `ghc-x.y.z.stack2cabal.project`
- `ghc-x.y.z.cabal2stack.yaml`
- `ghc-x.y.z.cabal2stack.yaml`
2 changes: 1 addition & 1 deletion alternatives/yaml2stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ dependencies.

[^working-dir]: The `.yaml` fragments are written to `.updo/dhall2yaml2stack`,
copied to a bash `$(mktemp -d)` temporary directory and then stitched together
there. There's a note in the make file explaining how to keep these fragments.
there. There's a note in the make file explaining how to keep these fragments.
2 changes: 1 addition & 1 deletion empty/constraints.dhall
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[] : List { dep : Text, ver : Text }
[] : List { dep : Text, ver : Text }
2 changes: 1 addition & 1 deletion empty/source-pkgs.dhall
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[] : List { loc : Text, tag : Text, sub : List Text }
[] : List { loc : Text, tag : Text, sub : List Text }
15 changes: 15 additions & 0 deletions fix-whitespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
excluded-dirs:
- "dist-newstyle"

excluded-files:
- "**/*.mk"
- "**/Makefile"

included-files:
- "**/*.cabal"
- "**/*.dhall"
- "**/*.hs"
- "**/*.md"
- "**/*.project"
- "**/*.yaml"
- "**/*.yml"
2 changes: 1 addition & 1 deletion fourmolu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ let-style: auto
in-style: left-align
respectful: true
fixities: []
unicode: never
unicode: never
2 changes: 1 addition & 1 deletion project-dhall2config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ build-info: True
For this rule using `make --jobs`[^parallel-make] will speed up the recipe a
lot.

[^parallel-make]: https://www.gnu.org/software/make/manual/html_node/Parallel.html
[^parallel-make]: https://www.gnu.org/software/make/manual/html_node/Parallel.html
2 changes: 1 addition & 1 deletion project-nix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ The `Makefile` also has `project-versions.nix` as a target.
}
```

[^sorted]: Renamed from `sha256map-regenerate.py` and modified to sort the map by keys.
[^sorted]: Renamed from `sha256map-regenerate.py` and modified to sort the map by keys.
2 changes: 1 addition & 1 deletion project-skeleton/pkgs/all-in-one.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-- There is no <pkgname>.cabal package file or cabal.project file. To build
-- packages locally you need at minimum a <pkgname>.cabal file. You can use 'cabal
-- init' to create one.
--
--
-- For non-trivial projects you will also want a cabal.project file in the root
-- directory of your project. This file lists the packages in your project and all
-- other build configuration. See the Cabal user guide for full details.
Expand Down