Skip to content

Commit 0a636b6

Browse files
authored
Merge pull request #405 from BinderDavid/add-hlint-to-ci
Add code action which runs HLint on site.hs
2 parents 2eb7321 + 727b57c commit 0a636b6

File tree

2 files changed

+94
-0
lines changed

2 files changed

+94
-0
lines changed

.github/workflows/hlint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: HLint
2+
3+
on:
4+
push:
5+
paths:
6+
- '**/site.hs'
7+
branches:
8+
- main
9+
pull_request:
10+
paths:
11+
- '**/site.hs'
12+
types:
13+
- opened
14+
- synchronize
15+
- reopened
16+
17+
jobs:
18+
hlint:
19+
name: HLint
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Check site.hs with hlint
24+
uses: haskell-actions/hlint-scan@v1
25+
with:
26+
path: |
27+
**/site.hs
28+
hints: message_index/.hlint.yml

message-index/.hlint.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# HLint configuration file
2+
# https://github.com/ndmitchell/hlint
3+
##########################
4+
5+
# This file contains a template configuration file, which is typically
6+
# placed as .hlint.yaml in the root of your project
7+
8+
9+
# Specify additional command line arguments
10+
#
11+
# - arguments: [--color, --cpp-simple, -XQuasiQuotes]
12+
13+
14+
# Control which extensions/flags/modules/functions can be used
15+
#
16+
# - extensions:
17+
# - default: false # all extension are banned by default
18+
# - name: [PatternGuards, ViewPatterns] # only these listed extensions can be used
19+
# - {name: CPP, within: CrossPlatform} # CPP can only be used in a given module
20+
#
21+
# - flags:
22+
# - {name: -w, within: []} # -w is allowed nowhere
23+
#
24+
# - modules:
25+
# - {name: [Data.Set, Data.HashSet], as: Set} # if you import Data.Set qualified, it must be as 'Set'
26+
# - {name: Control.Arrow, within: []} # Certain modules are banned entirely
27+
#
28+
# - functions:
29+
# - {name: unsafePerformIO, within: []} # unsafePerformIO can only appear in no modules
30+
31+
32+
# Add custom hints for this project
33+
#
34+
# Will suggest replacing "wibbleMany [myvar]" with "wibbleOne myvar"
35+
# - error: {lhs: "wibbleMany [x]", rhs: wibbleOne x}
36+
37+
# The hints are named by the string they display in warning messages.
38+
# For example, if you see a warning starting like
39+
#
40+
# Main.hs:116:51: Warning: Redundant ==
41+
#
42+
# You can refer to that hint with `{name: Redundant ==}` (see below).
43+
44+
# Turn on hints that are off by default
45+
#
46+
# Ban "module X(module X) where", to require a real export list
47+
# - warn: {name: Use explicit module export list}
48+
#
49+
# Replace a $ b $ c with a . b $ c
50+
# - group: {name: dollar, enabled: true}
51+
#
52+
# Generalise map to fmap, ++ to <>
53+
# - group: {name: generalise, enabled: true}
54+
55+
56+
# Ignore some builtin hints
57+
# - ignore: {name: Use let}
58+
# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules
59+
60+
61+
# Define some custom infix operators
62+
# - fixity: infixr 3 ~^#^~
63+
64+
65+
# To generate a suitable file for HLint do:
66+
# $ hlint --default > .hlint.yaml

0 commit comments

Comments
 (0)