diff --git a/.github/workflows/whitespace.yml b/.github/workflows/whitespace.yml new file mode 100644 index 0000000..6ac20d3 --- /dev/null +++ b/.github/workflows/whitespace.yml @@ -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 diff --git a/ALTERNATIVES.md b/ALTERNATIVES.md index bd28684..2eed463 100644 --- a/ALTERNATIVES.md +++ b/ALTERNATIVES.md @@ -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: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ae6833..dc6f7c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -60,7 +60,7 @@ -- There is no .cabal package file or cabal.project file. To build -- packages locally you need at minimum a .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. @@ -71,4 +71,4 @@ ``` ### 1.0.0 -* First release \ No newline at end of file +* First release diff --git a/HACKING.md b/HACKING.md index e59ffe5..2b4b1f6 100644 --- a/HACKING.md +++ b/HACKING.md @@ -67,4 +67,4 @@ $ ./pkgs-sorted.hs , "./docs/" , "./testing/" ] -``` \ No newline at end of file +``` diff --git a/README.md b/README.md index 2e19f82..ea4e274 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 @@ -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 ``` diff --git a/TEMPLATES.md b/TEMPLATES.md index f4229b0..dad4fcf 100644 --- a/TEMPLATES.md +++ b/TEMPLATES.md @@ -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 -``` \ No newline at end of file +``` diff --git a/TESTING.md b/TESTING.md index 8345aa3..1fd4f48 100644 --- a/TESTING.md +++ b/TESTING.md @@ -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 @@ -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: \ @@ -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 @@ -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. ``` @@ -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` \ No newline at end of file +- `ghc-x.y.z.cabal2stack.yaml` diff --git a/alternatives/yaml2stack/README.md b/alternatives/yaml2stack/README.md index 74c0fba..1dc6e73 100644 --- a/alternatives/yaml2stack/README.md +++ b/alternatives/yaml2stack/README.md @@ -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. \ No newline at end of file +there. There's a note in the make file explaining how to keep these fragments. diff --git a/empty/constraints.dhall b/empty/constraints.dhall index e277cfb..4b91424 100644 --- a/empty/constraints.dhall +++ b/empty/constraints.dhall @@ -1 +1 @@ -[] : List { dep : Text, ver : Text } \ No newline at end of file +[] : List { dep : Text, ver : Text } diff --git a/empty/source-pkgs.dhall b/empty/source-pkgs.dhall index 65a2658..b79faa8 100644 --- a/empty/source-pkgs.dhall +++ b/empty/source-pkgs.dhall @@ -1 +1 @@ -[] : List { loc : Text, tag : Text, sub : List Text } \ No newline at end of file +[] : List { loc : Text, tag : Text, sub : List Text } diff --git a/fix-whitespace.yaml b/fix-whitespace.yaml new file mode 100644 index 0000000..5b8abd0 --- /dev/null +++ b/fix-whitespace.yaml @@ -0,0 +1,15 @@ +excluded-dirs: + - "dist-newstyle" + +excluded-files: + - "**/*.mk" + - "**/Makefile" + +included-files: + - "**/*.cabal" + - "**/*.dhall" + - "**/*.hs" + - "**/*.md" + - "**/*.project" + - "**/*.yaml" + - "**/*.yml" diff --git a/fourmolu.yaml b/fourmolu.yaml index 641857e..aeb2f5a 100644 --- a/fourmolu.yaml +++ b/fourmolu.yaml @@ -11,4 +11,4 @@ let-style: auto in-style: left-align respectful: true fixities: [] -unicode: never \ No newline at end of file +unicode: never diff --git a/project-dhall2config/README.md b/project-dhall2config/README.md index 79ae8a4..0d153f8 100644 --- a/project-dhall2config/README.md +++ b/project-dhall2config/README.md @@ -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 \ No newline at end of file +[^parallel-make]: https://www.gnu.org/software/make/manual/html_node/Parallel.html diff --git a/project-nix/README.md b/project-nix/README.md index 8b5fca2..f0fd9f3 100644 --- a/project-nix/README.md +++ b/project-nix/README.md @@ -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. \ No newline at end of file +[^sorted]: Renamed from `sha256map-regenerate.py` and modified to sort the map by keys. diff --git a/project-skeleton/pkgs/all-in-one.dhall b/project-skeleton/pkgs/all-in-one.dhall index 09ef423..13aa928 100644 --- a/project-skeleton/pkgs/all-in-one.dhall +++ b/project-skeleton/pkgs/all-in-one.dhall @@ -20,7 +20,7 @@ -- There is no .cabal package file or cabal.project file. To build -- packages locally you need at minimum a .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.