Skip to content

Commit

Permalink
lighter stylish-haskell job in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Diemand <codieplusplus@apax.net>
  • Loading branch information
CodiePP committed Aug 10, 2020
1 parent 7a72b76 commit 922b87e
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .buildkite/check-stylish.sh
Expand Up @@ -12,7 +12,7 @@ echo
echo "Running Stylish Haskell"
echo "======================="
echo
stylish-haskell -c .stylish-haskell.yaml -i $(git ls-files -- '*.hs')
stylish-haskell -c .stylish-haskell.yaml -i $(git ls-files -- '*.hs' | grep 'bm-timeline')

echo
echo
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Expand Up @@ -21,7 +21,7 @@ steps:
# system: x86_64-linux

- label: 'Check Stylish Haskell'
command: 'nix-shell --run ./.buildkite/check-stylish.sh'
command: 'nix-shell --pure --run ./.buildkite/check-stylish.sh nix/stack-shell.nix'
agents:
system: x86_64-linux

31 changes: 28 additions & 3 deletions .stylish-haskell.yaml
Expand Up @@ -276,9 +276,34 @@ newline: native
# needs to be aware of these, so it can parse the file correctly.
#
# No language extensions are enabled by default.
# language_extensions:
# - TemplateHaskell
# - QuasiQuotes
language_extensions:
- BangPatterns
- ConstraintKinds
- DataKinds
- DefaultSignatures
- DeriveDataTypeable
- DeriveGeneric
- ExistentialQuantification
- FlexibleContexts
- FlexibleInstances
- FunctionalDependencies
- GADTs
- GeneralizedNewtypeDeriving
- LambdaCase
- MultiParamTypeClasses
- MultiWayIf
- NoImplicitPrelude
- OverloadedStrings
- PolyKinds
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TemplateHaskell
- TupleSections
- TypeApplications
- TypeFamilies
- ViewPatterns
- ExplicitNamespaces

# Attempt to find the cabal file in ancestors of the current directory, and
# parse options (currently only language extensions) from that.
Expand Down
15 changes: 7 additions & 8 deletions bm-timeline/src/Cardano/BM/AddToChain.hs
Expand Up @@ -9,14 +9,13 @@ import Data.Text.Lazy (Text, unpack)

import Cardano.BM.Common

data AddToChain
= AddToChain
{ node :: NodeId
, slot :: SlotNum
, timestamp :: Timestamp
, msg :: Text
}
deriving (Show)
data AddToChain = AddToChain
{ node :: NodeId
, slot :: SlotNum
, timestamp :: Timestamp
, msg :: Text
}
deriving (Show)

instance Lineparser AddToChain where
-- example:
Expand Down
21 changes: 10 additions & 11 deletions bm-timeline/src/Cardano/BM/Adopted.hs
Expand Up @@ -9,17 +9,16 @@ import Data.Text.Lazy (Text, unpack)

import Cardano.BM.Common

data Adopted
= Adopted
{ node :: NodeId
, slot :: SlotNum
, timestamp :: Timestamp
, msg :: Text
, blockhash :: Text
, ntx :: Int
, bsz :: Int
}
deriving (Show)
data Adopted = Adopted
{ node :: NodeId
, slot :: SlotNum
, timestamp :: Timestamp
, msg :: Text
, blockhash :: Text
, ntx :: Int
, bsz :: Int
}
deriving (Show)

instance Lineparser Adopted where
-- example:
Expand Down
13 changes: 6 additions & 7 deletions bm-timeline/src/Cardano/BM/CPUticks.hs
Expand Up @@ -9,13 +9,12 @@ import Data.Text.Lazy (unpack)

import Cardano.BM.Common

data CPUticks
= CPUticks
{ timestamp :: Timestamp
, ticks :: Int
, node :: NodeId
}
deriving (Show)
data CPUticks = CPUticks
{ timestamp :: Timestamp
, ticks :: Int
, node :: NodeId
}
deriving (Show)

instance Lineparser CPUticks where
-- example:
Expand Down
15 changes: 7 additions & 8 deletions bm-timeline/src/Cardano/BM/Leader.hs
Expand Up @@ -9,14 +9,13 @@ import Data.Text.Lazy (Text, unpack)

import Cardano.BM.Common

data Leader
= Leader
{ node :: NodeId
, slot :: SlotNum
, timestamp :: Timestamp
, msg :: Text
}
deriving (Show)
data Leader = Leader
{ node :: NodeId
, slot :: SlotNum
, timestamp :: Timestamp
, msg :: Text
}
deriving (Show)

instance Lineparser Leader where
-- example:
Expand Down
13 changes: 6 additions & 7 deletions bm-timeline/src/Cardano/BM/MemResident.hs
Expand Up @@ -9,13 +9,12 @@ import Data.Text.Lazy (unpack)

import Cardano.BM.Common

data MemResident
= MemResident
{ timestamp :: Timestamp
, memresident :: Int
, node :: NodeId
}
deriving (Show)
data MemResident = MemResident
{ timestamp :: Timestamp
, memresident :: Int
, node :: NodeId
}
deriving (Show)

instance Lineparser MemResident where
-- example:
Expand Down
15 changes: 7 additions & 8 deletions bm-timeline/src/Cardano/BM/TxAdopted.hs
Expand Up @@ -9,14 +9,13 @@ import Data.Text.Lazy (Text, unpack)

import Cardano.BM.Common

data TxAdopted
= TxAdopted
{ txid :: Text
, timestamp :: Timestamp
, node :: NodeId
, slot :: SlotNum
}
deriving (Show)
data TxAdopted = TxAdopted
{ txid :: Text
, timestamp :: Timestamp
, node :: NodeId
, slot :: SlotNum
}
deriving (Show)

instance Lineparser TxAdopted where
-- example:
Expand Down
13 changes: 6 additions & 7 deletions bm-timeline/src/Cardano/BM/TxMempool.hs
Expand Up @@ -9,13 +9,12 @@ import Data.Text.Lazy (Text, unpack)

import Cardano.BM.Common

data TxMempool
= TxMempool
{ txid :: Text
, timestamp :: Timestamp
, node :: NodeId
}
deriving (Show)
data TxMempool = TxMempool
{ txid :: Text
, timestamp :: Timestamp
, node :: NodeId
}
deriving (Show)

instance Lineparser TxMempool where
-- example:
Expand Down
2 changes: 1 addition & 1 deletion nix/stack-shell.nix
Expand Up @@ -4,6 +4,6 @@ with import ./. {};
haskell.lib.buildStackProject {
name = "stack-env";
exactDeps = false;
buildInputs = with pkgs; [ cabal-install stack zlib openssl gmp libffi git systemd haskellPackages.happy ];
buildInputs = with pkgs; [ cabal-install stack zlib openssl gmp libffi git systemd haskellPackages.happy stylish-haskell ];
ghc = (import ../shell.nix {inherit pkgs;}).ghc;
}

0 comments on commit 922b87e

Please sign in to comment.