Skip to content

Commit e414ee3

Browse files
committed
initial commit
1 parent 4e819e0 commit e414ee3

Some content is hidden

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

57 files changed

+2661
-0
lines changed

.codeclimate.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
engines:
2+
hlint:
3+
enabled: true
4+
ratings:
5+
paths:
6+
- "**.hs"

.ghci

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
:seti -XOverloadedStrings
2+
:seti -XScopedTypeVariables
3+
4+
:set -Wall
5+
:set -fno-warn-type-defaults
6+
:set -fwarn-unused-binds
7+
:set -fwarn-unused-imports
8+
9+
:set +s
10+
:set +t
11+
:set +m
12+
13+
:set -fobject-code
14+
:set -fno-code

.hlint.yaml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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+
# Specify additional command line arguments
9+
#
10+
- arguments:
11+
- --color
12+
- --cpp-simple
13+
- -XQuasiQuotes
14+
15+
# Control which extensions/flags/modules/functions can be used
16+
#
17+
# - extensions:
18+
# - default: false # all extension are banned by default
19+
# - name: [PatternGuards, ViewPatterns] # only these listed extensions can be used
20+
#
21+
# - {name: CPP, within: CrossPlatform} # CPP can only be used in a given module
22+
#
23+
# - flags:
24+
# - {name: -w, within: []} # -w is allowed nowhere
25+
#
26+
- modules:
27+
# if you import Data.Set qualified, it must be as 'Set'
28+
# - {name: Control.Arrow, within: []} # Certain modules are banned entirely
29+
- {name: [Data.HashMap.Strict], as: HashMap}
30+
- {name: [Data.ByteString], as: BS}
31+
- {name: [Data.ByteString.Lazy], as: BL}
32+
- {name: [Data.ByteString.Char8], as: C}
33+
- {name: [Data.ByteString.Lazy.Char8], as: CL}
34+
- {name: [Data.Text], as: T}
35+
- {name: [Data.Text.IO], as: TIO}
36+
- {name: [Data.Text.Lazy.IO], as: TLIO}
37+
- {name: [Data.Text.Encoding], as: TE}
38+
- {name: [Data.Text.Lazy.Encoding], as: TLE}
39+
- {name: [Data.Aeson], as: JSON}
40+
41+
# - functions:
42+
# - {name: unsafePerformIO, within: []} # unsafePerformIO can only appear in no modules
43+
44+
45+
# Add custom hints for this project
46+
#
47+
# Will suggest replacing "wibbleMany [myvar]" with "wibbleOne myvar"
48+
# - error: {lhs: "wibbleMany [x]", rhs: wibbleOne x}
49+
50+
51+
# Turn on hints that are off by default
52+
#
53+
# Ban "module X(module X) where", to require a real export list
54+
# - warn: {name: Use explicit module export list}
55+
#
56+
# Replace a $ b $ c with a . b $ c
57+
# - group: {name: dollar, enabled: true}
58+
#
59+
# Generalise map to fmap, ++ to <>
60+
- group: {name: generalise, enabled: true}
61+
62+
# Ignore some builtin hints
63+
- ignore: {name: Use String}
64+
# - ignore: {name: Use let}
65+
# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules
66+
67+
# Define some custom infix operators
68+
# - fixity: infixr 3 ~^#^~
69+
70+
# To generate a suitable file for HLint do:
71+
# $ hlint --default > .hlint.yaml

.stylish-haskell.yaml

+189
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# stylish-haskell configuration file
2+
# ==================================
3+
4+
# The stylish-haskell tool is mainly configured by specifying steps. These steps
5+
# are a list, so they have an order, and one specific step may appear more than
6+
# once (if needed). Each file is processed by these steps in the given order.
7+
steps:
8+
# Convert some ASCII sequences to their Unicode equivalents. This is disabled
9+
# by default.
10+
# - unicode_syntax:
11+
# # In order to make this work, we also need to insert the UnicodeSyntax
12+
# # language pragma. If this flag is set to true, we insert it when it's
13+
# # not already present. You may want to disable it if you configure
14+
# # language extensions using some other method than pragmas. Default:
15+
# # true.
16+
# add_language_pragma: true
17+
18+
# Align the right hand side of some elements. This is quite conservative
19+
# and only applies to statements where each element occupies a single
20+
# line.
21+
- simple_align:
22+
cases: true
23+
top_level_patterns: true
24+
records: true
25+
26+
# Import cleanup
27+
- imports:
28+
# There are different ways we can align names and lists.
29+
#
30+
# - global: Align the import names and import list throughout the entire
31+
# file.
32+
#
33+
# - file: Like global, but don't add padding when there are no qualified
34+
# imports in the file.
35+
#
36+
# - group: Only align the imports per group (a group is formed by adjacent
37+
# import lines).
38+
#
39+
# - none: Do not perform any alignment.
40+
#
41+
# Default: global.
42+
align: group
43+
44+
# Folowing options affect only import list alignment.
45+
#
46+
# List align has following options:
47+
#
48+
# - after_alias: Import list is aligned with end of import including
49+
# 'as' and 'hiding' keywords.
50+
#
51+
# > import qualified Data.List as List (concat, foldl, foldr, head,
52+
# > init, last, length)
53+
#
54+
# - with_alias: Import list is aligned with start of alias or hiding.
55+
#
56+
# > import qualified Data.List as List (concat, foldl, foldr, head,
57+
# > init, last, length)
58+
#
59+
# - new_line: Import list starts always on new line.
60+
#
61+
# > import qualified Data.List as List
62+
# > (concat, foldl, foldr, head, init, last, length)
63+
#
64+
# Default: after_alias
65+
list_align: after_alias
66+
67+
# Long list align style takes effect when import is too long. This is
68+
# determined by 'columns' setting.
69+
#
70+
# - inline: This option will put as much specs on same line as possible.
71+
#
72+
# - new_line: Import list will start on new line.
73+
#
74+
# - new_line_multiline: Import list will start on new line when it's
75+
# short enough to fit to single line. Otherwise it'll be multiline.
76+
#
77+
# - multiline: One line per import list entry.
78+
# Type with contructor list acts like single import.
79+
#
80+
# > import qualified Data.Map as M
81+
# > ( empty
82+
# > , singleton
83+
# > , ...
84+
# > , delete
85+
# > )
86+
#
87+
# Default: inline
88+
long_list_align: new_line_multiline
89+
90+
# Align empty list (importing instances)
91+
#
92+
# Empty list align has following options
93+
#
94+
# - inherit: inherit list_align setting
95+
#
96+
# - right_after: () is right after the module name:
97+
#
98+
# > import Vector.Instances ()
99+
#
100+
# Default: inherit
101+
empty_list_align: right_after
102+
103+
# List padding determines indentation of import list on lines after import.
104+
# This option affects 'long_list_align'.
105+
#
106+
# - <integer>: constant value
107+
#
108+
# - module_name: align under start of module name.
109+
# Useful for 'file' and 'group' align settings.
110+
list_padding: 4
111+
112+
# Separate lists option affects formating of import list for type
113+
# or class. The only difference is single space between type and list
114+
# of constructors, selectors and class functions.
115+
#
116+
# - true: There is single space between Foldable type and list of it's
117+
# functions.
118+
#
119+
# > import Data.Foldable (Foldable (fold, foldl, foldMap))
120+
#
121+
# - false: There is no space between Foldable type and list of it's
122+
# functions.
123+
#
124+
# > import Data.Foldable (Foldable(fold, foldl, foldMap))
125+
#
126+
# Default: true
127+
separate_lists: true
128+
129+
# Language pragmas
130+
- language_pragmas:
131+
# We can generate different styles of language pragma lists.
132+
#
133+
# - vertical: Vertical-spaced language pragmas, one per line.
134+
#
135+
# - compact: A more compact style.
136+
#
137+
# - compact_line: Similar to compact, but wrap each line with
138+
# `{-#LANGUAGE #-}'.
139+
#
140+
# Default: vertical.
141+
style: vertical
142+
143+
# Align affects alignment of closing pragma brackets.
144+
#
145+
# - true: Brackets are aligned in same collumn.
146+
#
147+
# - false: Brackets are not aligned together. There is only one space
148+
# between actual import and closing bracket.
149+
#
150+
# Default: true
151+
align: true
152+
153+
# stylish-haskell can detect redundancy of some language pragmas. If this
154+
# is set to true, it will remove those redundant pragmas. Default: true.
155+
remove_redundant: true
156+
157+
# Replace tabs by spaces. This is disabled by default.
158+
# - tabs:
159+
# # Number of spaces to use for each tab. Default: 8, as specified by the
160+
# # Haskell report.
161+
# spaces: 8
162+
163+
# Remove trailing whitespace
164+
- trailing_whitespace: {}
165+
166+
# A common setting is the number of columns (parts of) code will be wrapped
167+
# to. Different steps take this into account. Default: 80.
168+
columns: 92
169+
170+
# By default, line endings are converted according to the OS. You can override
171+
# preferred format here.
172+
#
173+
# - native: Native newline format. CRLF on Windows, LF on other OSes.
174+
#
175+
# - lf: Convert to LF ("\n").
176+
#
177+
# - crlf: Convert to CRLF ("\r\n").
178+
#
179+
# Default: native.
180+
newline: native
181+
182+
# Sometimes, language extensions are specified in a cabal file or from the
183+
# command line instead of using language pragmas in the file. stylish-haskell
184+
# needs to be aware of these, so it can parse the file correctly.
185+
#
186+
# No language extensions are enabled by default.
187+
# language_extensions:
188+
# - TemplateHaskell
189+
# - QuasiQuotes

.travis.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
sudo: true
2+
language: haskell
3+
ghc:
4+
- "8.6.5"
5+
6+
git:
7+
depth: 5
8+
9+
cache:
10+
directories:
11+
- "$HOME/.stack"
12+
- "$TRAVIS_BUILD_DIR/.stack-work"
13+
14+
matrix:
15+
Include:
16+
- ghc: 8.6.3
17+
env: STACK_YAML="$TRAVIS_BUILD_DIR/stack.yaml"
18+
19+
install:
20+
- curl -sSL https://get.haskellstack.org/ | sh
21+
- stack --version
22+
- stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
23+
24+
script:
25+
- stack test --system-ghc
26+
27+
notifications:
28+
email: false

Makefile

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package = fission-web-api
2+
3+
stack_yaml = STACK_YAML="stack.yaml"
4+
stack = $(stack_yaml) stack
5+
6+
build:
7+
$(stack) build --fast $(package):lib
8+
9+
release:
10+
$(stack) build
11+
12+
dirty:
13+
$(stack) build --ghc-options=-fforce-recomp $(package)
14+
15+
profile:
16+
$(stack) --work-dir .stack-work-profiling --profile build --fast
17+
18+
install:
19+
$(stack) install --fast
20+
21+
ghci:
22+
$(stack) repl $(package):lib --no-build --no-load --ghci-options='-j6 +RTS -A128m'
23+
24+
test:
25+
$(stack) build --test --fast $(package)
26+
27+
test-ghci:
28+
$(stack) ghci $(package):test:$(package)-tests --ghci-options='-j6 +RTS -A128m'
29+
30+
bench:
31+
$(stack) build --fast --bench $(package)
32+
33+
dev:
34+
$(stack) exec -- ghcid -c "stack ghci $(package):lib --test --main-is $(package):fission-web"
35+
36+
live:
37+
$(stack) exec -- yesod devel
38+
39+
setup:
40+
stack install ghcid && stack install yesod-bin
41+
42+
.PHONY : build dirty run install ghci test test-ghci watch

Setup.hs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Distribution.Simple
2+
main = defaultMain

0 commit comments

Comments
 (0)