Skip to content

Commit 6f8599e

Browse files
committed
[CO-278] Migrate log-classifier to stack.
1 parent 3b08a47 commit 6f8599e

26 files changed

+734
-12
lines changed

.gitignore

Lines changed: 100 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,100 @@
1-
token
2-
assign_to
3-
emailAddress.txt
1+
# Cabal & Stack
2+
.stack-work/
3+
*/dist
4+
5+
# From daedalus-bridge
6+
node_modules/*
7+
8+
# Config files
9+
.ghci
10+
11+
# Our custom build script (util-scripts/build.sh)
12+
b
13+
.no-nix
14+
.ram
15+
.Werror
16+
17+
# Various DBs
18+
node-db*
19+
wallet-db/
20+
wallet-new-db/
21+
db-*/
22+
wdb-*/
23+
24+
# Keys
25+
*.key
26+
*.key.lock
27+
keys
28+
!secrets/*.key
29+
!scripts/tls-files/server.key
30+
tmp-secrets/
31+
32+
# Node runtime data
33+
logs
34+
run
35+
36+
# Emacs
37+
*~
38+
*#
39+
.#*
40+
.dir-locals.el
41+
GTAGS
42+
GRTAGS
43+
GPATH
44+
TAGS
45+
46+
# Vim
47+
tags*
48+
49+
# Intellij Idea & intellij-haskell
50+
.idea
51+
.ideaHaskellLib
52+
*.iml
53+
54+
# Atom
55+
.haskell-ghc-mod.json
56+
57+
# Misc
58+
.DS_Store
59+
*.swp
60+
61+
# Compiled-scripts cruft
62+
scripts/haskell/dependencies.hs
63+
scripts/haskell/dependencies.hi
64+
scripts/haskell/dependencies.o
65+
scripts/haskell/dependencies
66+
67+
# 'pkgs/stack2nix' is a symlink into the nix store, it can safely be ignored
68+
pkgs/stack2nix
69+
nixpkgs # in case generate.sh clones nixpkgs in here
70+
pkgs/result
71+
72+
# explorer
73+
explorer-node.log.*
74+
explorer-node.log
75+
explorer.log
76+
socket-io.log
77+
78+
# importify
79+
.importify
80+
81+
# custom configuration
82+
custom-wallet-config.nix
83+
84+
# wallet web API benchmarking results
85+
wallet-new/bench/results/*.csv
86+
wallet-new/bench/results/*.txt
87+
88+
# wallet web API golden tests
89+
wallet-new/test/golden/*.txt.new
90+
91+
# cardano-state-* for wallet data
92+
cardano-state-*
93+
state-*
94+
95+
# exchange topology file
96+
exchange-topology.yaml
97+
98+
# launch scripts
99+
launch_*
100+
result*

.hindent.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
indent-size: 4
2+
line-length: 80
3+
force-trailing-newline: true

.stylish-haskell.yaml

Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
# Stylish-haskell configuration file used for cardano-sl by Serokell.
2+
# It's based on default config provided by `stylish-haskell --defaults` but has some changes
3+
# ==================================
4+
5+
# The stylish-haskell tool is mainly configured by specifying steps. These steps
6+
# are a list, so they have an order, and one specific step may appear more than
7+
# once (if needed). Each file is processed by these steps in the given order.
8+
steps:
9+
# Convert some ASCII sequences to their Unicode equivalents. This is disabled
10+
# by default.
11+
# - unicode_syntax:
12+
# # In order to make this work, we also need to insert the UnicodeSyntax
13+
# # language pragma. If this flag is set to true, we insert it when it's
14+
# # not already present. You may want to disable it if you configure
15+
# # language extensions using some other method than pragmas. Default:
16+
# # true.
17+
# add_language_pragma: true
18+
19+
# Align the right hand side of some elements. This is quite conservative
20+
# and only applies to statements where each element occupies a single
21+
# line.
22+
- simple_align:
23+
cases: true
24+
top_level_patterns: true
25+
records: true
26+
27+
# Import cleanup
28+
- imports:
29+
# There are different ways we can align names and lists.
30+
#
31+
# - global: Align the import names and import list throughout the entire
32+
# file.
33+
#
34+
# - file: Like global, but don't add padding when there are no qualified
35+
# imports in the file.
36+
#
37+
# - group: Only align the imports per group (a group is formed by adjacent
38+
# import lines).
39+
#
40+
# - none: Do not perform any alignment.
41+
#
42+
# Default: global.
43+
align: global
44+
45+
# The following options affect only import list alignment.
46+
#
47+
# List align has following options:
48+
#
49+
# - after_alias: Import list is aligned with end of import including
50+
# 'as' and 'hiding' keywords.
51+
#
52+
# > import qualified Data.List as List (concat, foldl, foldr, head,
53+
# > init, last, length)
54+
#
55+
# - with_alias: Import list is aligned with start of alias or hiding.
56+
#
57+
# > import qualified Data.List as List (concat, foldl, foldr, head,
58+
# > init, last, length)
59+
#
60+
# - new_line: Import list starts always on new line.
61+
#
62+
# > import qualified Data.List as List
63+
# > (concat, foldl, foldr, head, init, last, length)
64+
#
65+
# Default: after_alias
66+
list_align: after_alias
67+
68+
# Right-pad the module names to align imports in a group:
69+
#
70+
# - true: a little more readable
71+
#
72+
# > import qualified Data.List as List (concat, foldl, foldr,
73+
# > init, last, length)
74+
# > import qualified Data.List.Extra as List (concat, foldl, foldr,
75+
# > init, last, length)
76+
#
77+
# - false: diff-safe
78+
#
79+
# > import qualified Data.List as List (concat, foldl, foldr, init,
80+
# > last, length)
81+
# > import qualified Data.List.Extra as List (concat, foldl, foldr,
82+
# > init, last, length)
83+
#
84+
# Default: true
85+
86+
# Note: we intentionally disable it to make diffs less verbose and avoid
87+
# merge conflicts in some cases.
88+
pad_module_names: false
89+
90+
# Long list align style takes effect when import is too long. This is
91+
# determined by 'columns' setting.
92+
#
93+
# - inline: This option will put as much specs on same line as possible.
94+
#
95+
# - new_line: Import list will start on new line.
96+
#
97+
# - new_line_multiline: Import list will start on new line when it's
98+
# short enough to fit to single line. Otherwise it'll be multiline.
99+
#
100+
# - multiline: One line per import list entry.
101+
# Type with constructor list acts like single import.
102+
#
103+
# > import qualified Data.Map as M
104+
# > ( empty
105+
# > , singleton
106+
# > , ...
107+
# > , delete
108+
# > )
109+
#
110+
# Default: inline
111+
long_list_align: inline
112+
113+
# Align empty list (importing instances)
114+
#
115+
# Empty list align has following options
116+
#
117+
# - inherit: inherit list_align setting
118+
#
119+
# - right_after: () is right after the module name:
120+
#
121+
# > import Vector.Instances ()
122+
#
123+
# Default: inherit
124+
empty_list_align: inherit
125+
126+
# List padding determines indentation of import list on lines after import.
127+
# This option affects 'long_list_align'.
128+
#
129+
# - <integer>: constant value
130+
#
131+
# - module_name: align under start of module name.
132+
# Useful for 'file' and 'group' align settings.
133+
list_padding: 4
134+
135+
# Separate lists option affects formatting of import list for type
136+
# or class. The only difference is single space between type and list
137+
# of constructors, selectors and class functions.
138+
#
139+
# - true: There is single space between Foldable type and list of it's
140+
# functions.
141+
#
142+
# > import Data.Foldable (Foldable (fold, foldl, foldMap))
143+
#
144+
# - false: There is no space between Foldable type and list of it's
145+
# functions.
146+
#
147+
# > import Data.Foldable (Foldable(fold, foldl, foldMap))
148+
#
149+
# Default: true
150+
separate_lists: true
151+
152+
# Space surround option affects formatting of import lists on a single
153+
# line. The only difference is single space after the initial
154+
# parenthesis and a single space before the terminal parenthesis.
155+
#
156+
# - true: There is single space associated with the enclosing
157+
# parenthesis.
158+
#
159+
# > import Data.Foo ( foo )
160+
#
161+
# - false: There is no space associated with the enclosing parenthesis
162+
#
163+
# > import Data.Foo (foo)
164+
#
165+
# Default: false
166+
space_surround: false
167+
168+
# Language pragmas
169+
- language_pragmas:
170+
# We can generate different styles of language pragma lists.
171+
#
172+
# - vertical: Vertical-spaced language pragmas, one per line.
173+
#
174+
# - compact: A more compact style.
175+
#
176+
# - compact_line: Similar to compact, but wrap each line with
177+
# `{-#LANGUAGE #-}'.
178+
#
179+
# Default: vertical.
180+
style: vertical
181+
182+
# stylish-haskell can detect redundancy of some language pragmas. If this
183+
# is set to true, it will remove those redundant pragmas. Default: true.
184+
remove_redundant: true
185+
186+
# Replace tabs by spaces. This is disabled by default.
187+
# - tabs:
188+
# # Number of spaces to use for each tab. Default: 8, as specified by the
189+
# # Haskell report.
190+
# spaces: 8
191+
192+
# Remove trailing whitespace
193+
- trailing_whitespace: {}
194+
195+
# A common setting is the number of columns (parts of) code will be wrapped
196+
# to. Different steps take this into account. Default: 80.
197+
#
198+
# Note: we tend to write code which fits into 80 characters, in some cases
199+
# 100 is acceptable. For imports we always permit 100 characters because it
200+
# decreases verbosity of diffs and makes merging easier.
201+
columns: 100
202+
203+
# By default, line endings are converted according to the OS. You can override
204+
# preferred format here.
205+
#
206+
# - native: Native newline format. CRLF on Windows, LF on other OSes.
207+
#
208+
# - lf: Convert to LF ("\n").
209+
#
210+
# - crlf: Convert to CRLF ("\r\n").
211+
#
212+
# Default: native.
213+
newline: native
214+
215+
# These syntax-affecting language extensions are enabled so that
216+
# stylish-haskell wouldn't fail with parsing errors when processing files
217+
# in projects that have those extensions enabled in the .cabal file
218+
# rather than locally.
219+
#
220+
# To my best knowledge, no harm should result from enabling an extension
221+
# that isn't actually used in the file/project. —@neongreen
222+
language_extensions:
223+
- BangPatterns
224+
- ConstraintKinds
225+
- DataKinds
226+
- DefaultSignatures
227+
- DeriveDataTypeable
228+
- DeriveGeneric
229+
- FlexibleContexts
230+
- FlexibleInstances
231+
- FunctionalDependencies
232+
- GADTs
233+
- GeneralizedNewtypeDeriving
234+
- LambdaCase
235+
- MultiParamTypeClasses
236+
- MultiWayIf
237+
- NoImplicitPrelude
238+
- OverloadedStrings
239+
- PolyKinds
240+
- RecordWildCards
241+
- ScopedTypeVariables
242+
- StandaloneDeriving
243+
- TemplateHaskell
244+
- TupleSections
245+
- TypeApplications
246+
- TypeFamilies
247+
- ViewPatterns

ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Changelog for log-classifier
2+
3+
## Unreleased changes

LICENSE

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Copyright Author name here (c) 2018
2+
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer in the documentation and/or other materials provided
14+
with the distribution.
15+
16+
* Neither the name of Author name here nor the names of other
17+
contributors may be used to endorse or promote products derived
18+
from this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# log-classifier

Setup.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import Distribution.Simple
2+
main = defaultMain

0 commit comments

Comments
 (0)