Skip to content

Commit c3bd578

Browse files
authored
Merge pull request #1 from cgohla/noCapitalisms
No capitalisms
2 parents 7013099 + 373e880 commit c3bd578

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1297
-560
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
push:
44
branches-ignore:
55
- 'ghc-next*'
6-
- 'ghc-9.10*'
6+
- 'ghc-9.12*'
77
pull_request:
88
branches-ignore:
99
- 'ghc-next*'
@@ -12,36 +12,32 @@ on:
1212
jobs:
1313
test:
1414
runs-on: ${{ matrix.os }}
15-
1615
strategy:
1716
fail-fast: false
1817
matrix:
1918
os: [ubuntu-latest]
20-
ghc: ['9.8', '9.6', '9.4']
19+
ghc: ['9.12', '9.10', '9.8']
2120
include:
2221
- os: windows-latest
23-
ghc: '9.8'
22+
ghc: '9.12'
2423
- os: macOS-latest
25-
ghc: '9.8'
26-
24+
ghc: '9.12'
2725
steps:
2826
- run: git config --global core.autocrlf false
29-
- uses: actions/checkout@v2
30-
- uses: haskell/actions/setup@v2
27+
- uses: actions/checkout@v4
28+
- uses: haskell-actions/setup@v2
3129
id: setup-haskell
3230
with:
3331
ghc-version: ${{ matrix.ghc }}
34-
- name: Get GHC libdir
35-
id: get-ghc-libdir
36-
run: |
37-
echo "libdir=$(ghc --print-libdir)" >> $GITHUB_OUTPUT
38-
shell: bash
32+
- run: cabal install apply-refact --install-method=copy
33+
# Not available on GHC 9.10, see https://github.com/mpickering/apply-refact/pull/149
34+
if: matrix.ghc == '9.12' || matrix.ghc == '9.8'
3935
- run: cabal v2-freeze --enable-tests
40-
- uses: actions/cache@v2
36+
- uses: actions/cache@v4
4137
with:
4238
path: ${{ steps.setup-haskell.outputs.cabal-store }}
43-
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ steps.get-ghc-libdir.outputs.libdir }}-${{ hashFiles('cabal.project.freeze') }}
44-
- run: cabal new-install apply-refact --install-method=copy
39+
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
40+
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
4541
- uses: ndmitchell/neil@master
4642
with:
4743
hlint-arguments: src

.github/workflows/ghc-9.10.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/ghc-next.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,46 @@ on:
44
branches:
55
- 'ghc-next*'
66
schedule:
7-
- cron: '0 3 * * 5'
7+
- cron: '0 8 * * 6' # once a week. saturdays at 8am
88
jobs:
9-
ghc-9-10:
9+
ghc-next:
1010
name: ${{ matrix.os }}
1111
runs-on: ${{ matrix.os }}-latest
1212
strategy:
1313
fail-fast: false
1414
matrix:
1515
os: [ubuntu, macos, windows]
1616
steps:
17+
- uses: actions/checkout@v4
1718
- uses: haskell-actions/setup@v2
19+
id: setup-haskell
1820
with:
19-
ghc-version: '9.8.1'
20-
enable-stack: true
21-
stack-version: '2.15.7'
22-
# - name: Upgrade stack from git
23-
# run: |-
24-
# stack upgrade --git
25-
# echo "$HOME/.local/bin" >> $GITHUB_PATH
26-
# which stack
27-
# stack --version
28-
# shell: bash
29-
- name: Install build tools
21+
ghc-version: 9.10.1
22+
cabal-version: 'latest'
23+
- name: Install build tools (macOS)
3024
run: brew install automake
3125
if: matrix.os == 'macos'
32-
- name: Configure
33-
# e.g. Don't recursively delete '.stack-work' (`stack clean --full`)
34-
run: echo "GHCLIB_AZURE='1'" >> $GITHUB_ENV
26+
- name: Configure msys2 (windows)
3527
shell: bash
36-
- name: Boot
3728
run: |-
38-
cabal update
29+
echo "MSYSTEM=CLANG64" >> $GITHUB_ENV
30+
echo "/c/mingw64/usr/bin" >> $GITHUB_PATH
31+
echo "/c/msys64/usr/bin" >> $GITHUB_PATH
32+
if: matrix.os == 'windows'
33+
- name: Run hlint-from-scratch (windows)
34+
shell: C:\msys64\usr\bin\bash.exe --noprofile --norc -e -o pipefail '{0}'
35+
run: |-
36+
GHCLIB_AZURE=1; export GHCLIB_AZURE
37+
pacman -S autoconf automake-wrapper make patch python tar mintty --noconfirm
3938
git clone https://github.com/shayne-fletcher/hlint-from-scratch.git
4039
hlint-from-scratch/hlint-from-scratch.sh --init="$HOME/project"
40+
hlint-from-scratch/hlint-from-scratch.sh --ghc-flavor="ghc-master" --no-checkout
41+
if: matrix.os == 'windows'
42+
- name: Run hlint-from-scratch (unix)
4143
shell: bash
42-
- name: Build and Test ('ghc-next')
43-
run: hlint-from-scratch/hlint-from-scratch.sh --ghc-flavor="" --stack-yaml=stack-exact.yaml --resolver=ghc-9.8.1 --no-checkout
44-
shell: bash
44+
run: |-
45+
GHCLIB_AZURE=1; export GHCLIB_AZURE
46+
git clone https://github.com/shayne-fletcher/hlint-from-scratch.git
47+
hlint-from-scratch/hlint-from-scratch.sh --init="$HOME/project"
48+
hlint-from-scratch/hlint-from-scratch.sh --ghc-flavor="ghc-master" --no-checkout
49+
if: matrix.os == 'ubuntu' || matrix.os == 'macos'

.github/workflows/release.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
name: release
22
on:
3-
# Match when pushing tags v*, i.e. v1.0, v20.15.10
4-
push:
5-
tags: ['v*']
6-
3+
workflow_dispatch:
4+
release:
5+
types: [created]
6+
77
jobs:
88
init:
99
runs-on: ubuntu-latest
1010
outputs:
11-
upload_url: ${{ steps.create-release.outputs.upload_url }}
11+
upload_url: ${{ steps.release.outputs.upload_url }}
1212
filename: hlint-${{ steps.reftags_version.outputs._1 }}
1313

1414
steps:
15+
- uses: joutvhu/get-release@v1
16+
id: release
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
with:
20+
latest: true
21+
1522
- uses: rishabhgupta/split-by@v1
1623
id: reftags_version
1724
with:
18-
string: ${{ github.ref }} # e.g. refs/tags/v0.11.1.1
25+
string: ${{ steps.release.outputs.tag_name }} # e.g. refs/tags/v0.11.1.1
1926
split-by: 'v'
2027

21-
- uses: actions/create-release@v1
22-
id: create-release
23-
env:
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25-
with:
26-
tag_name: v${{ steps.reftags_version.outputs._1 }}
27-
release_name: v${{ steps.reftags_version.outputs._1 }}
28-
2928
build:
3029
needs: init
3130
runs-on: ${{ matrix.os }}
@@ -37,16 +36,16 @@ jobs:
3736
- os: ubuntu-20.04
3837
SUFFIX: x86_64-linux.tar.gz
3938
- os: macOS-latest
40-
SUFFIX: x86_64-osx.tar.gz
39+
SUFFIX: arm64-osx.tar.gz
4140
- os: windows-latest
4241
SUFFIX: x86_64-windows.zip
4342

4443
steps:
4544
- run: git config --global core.autocrlf false
46-
- uses: actions/checkout@v2
47-
- uses: haskell/actions/setup@v2
45+
- uses: actions/checkout@v4
46+
- uses: haskell-actions/setup@v2
4847
with:
49-
ghc-version: '9.6'
48+
ghc-version: '9.12'
5049
- uses: ndmitchell/neil@master
5150
with:
5251
make-release: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ stack*.yaml.lock
1616
.\#*\#
1717
/.sl/
1818
*.dump-hi
19+
.DS_Store

CHANGES.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
Changelog for HLint (* = breaking change)
22

3+
3.10, released 2024-02-02
4+
#1617, hints for when x <*> y could be y, e.g. []
5+
* #1594, upgrade to GHC 9.12
6+
#1568, add mapMaybe f (reverse x) ==> reverse (mapMaybe f x)
7+
#1569, avoid redundant Foldable.toList calls in Foldable operations
8+
#1571, rename a few hints to make them clearer
9+
#1599, add translated 0 0 hint for CodeWorld project
10+
#1600, add sum [x, y] ==> x + y
311
#1549, downgrade a few of the error severities to warn
412
3.8, released 2024-01-15
513
#1552, make --git and --ignore-glob work nicely together

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright Neil Mitchell 2006-2024.
1+
Copyright Neil Mitchell 2006-2025.
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,6 @@ If you're using git, it may be helpful to only run hlint on changed files. This
184184
{ git diff --diff-filter=d --name-only $(git merge-base HEAD origin/master) -- "***.hs" && git ls-files -o --exclude-standard -- "***.hs"; } | xargs hlint
185185
```
186186

187-
Because hlint's `--refactor` option only works when you pass a single file, this approach is also helpful to enable refactoring many files in a single command:
188-
189-
```bash
190-
{ git diff --diff-filter=d --name-only $(git merge-base HEAD origin/master) -- "***.hs" && git ls-files -o --exclude-standard -- "***.hs"; } | xargs -I file hlint file --refactor --refactor-options="--inplace --step"
191-
```
192-
193187
### Configuration
194188

195189
#### Why doesn't HLint know the fixity for my custom !@%$ operator?
@@ -447,7 +441,7 @@ and `qualifiedStyle` fields, only the first definition will take effect.
447441
- modules:
448442
- {name: [Data.Map, Data.Map.*], as: Map}
449443
- {name: Test.Hspec, within: **.*Spec }
450-
- {name: '**', importStyle: post}
444+
- {name: '**', qualifiedStyle: post}
451445
```
452446

453447
## Hacking HLint

cabal.project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
packages: ./hlint.cabal

0 commit comments

Comments
 (0)