Skip to content

Commit 7df57af

Browse files
author
HirotoShioi
committed
Add comments, remove unnecessary imports
1 parent 4cc3df9 commit 7df57af

File tree

7 files changed

+9
-11
lines changed

7 files changed

+9
-11
lines changed

src/Classify.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import Universum
1111
import qualified Codec.Archive.Zip as Zip
1212
import qualified Data.ByteString.Lazy.Char8 as LBSC
1313
import qualified Data.List.NonEmpty as N
14-
import Data.Map.Strict (Map)
1514
import qualified Data.Map.Strict as Map
1615
import GHC.Stack (HasCallStack)
1716
import Regex (MatchWithCaptures, Regex, RegexCompileError, RegexString, compileRegex,

src/LogAnalysis/Classifier.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ filterAnalysis as = do
5353
extractErrorCodes :: Analysis -> [ Text ]
5454
extractErrorCodes as = map (\(Knowledge{..}, _) -> renderErrorCode kErrorCode) $ Map.toList as
5555

56-
-- | TODO: Format the text in better way
56+
-- | TODO (Hiroto): Format the text in better way
5757
prettyFormatAnalysis :: Analysis -> LText
5858
prettyFormatAnalysis as =
5959
let aList = Map.toList as

src/LogAnalysis/KnowledgeCSVParser.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import qualified Data.Text.Lazy as LT
1111

1212
import LogAnalysis.Types (ErrorCode (..), Knowledge (..))
1313

14-
-- |Take any string that is inside quotes
14+
-- | Take any string that is inside quotes
1515
insideQuotes :: Parser LText
1616
insideQuotes =
1717
LT.append <$> (LT.fromStrict <$> ALT.takeWhile (/= '"'))
@@ -46,7 +46,7 @@ parseErrorCode =
4646
<|> (string "Unknown" >> return Unknown)
4747
<|> (string "Error" >> return Error)
4848

49-
-- |Parse each csv records
49+
-- | Parse each csv records
5050
parseKnowledge :: Parser Knowledge -- not really clean code..
5151
parseKnowledge = do
5252
e <- quotedField
@@ -60,6 +60,6 @@ parseKnowledge = do
6060
s <- quotedField
6161
return $ Knowledge e c p s
6262

63-
-- |Parse CSV file and create knowledgebase
63+
-- | Parse CSV file and create knowledgebase
6464
parseKnowLedgeBase :: Parser [ Knowledge ]
6565
parseKnowLedgeBase = many $ parseKnowledge <* endOfLine

src/LogAnalysis/Types.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module LogAnalysis.Types
1111

1212
import Universum
1313

14-
import Data.Map.Strict (Map)
1514
import qualified Data.Map.Strict as Map
1615

1716
-- | Identifier for each error
@@ -35,10 +34,10 @@ data ErrorCode
3534

3635
-- | Record identifying the issue
3736
data Knowledge = Knowledge
38-
{ kErrorText :: !LText -- ^ Text used for matching error lines
37+
{ kErrorText :: !LText  -- ^ Text used for matching error lines
3938
, kErrorCode :: !ErrorCode -- ^ Identity for error code
40-
, kProblem :: !LText -- ^ Text describing what is the problem
41-
, kSolution :: !LText -- ^ Text describing how to solve the issue
39+
, kProblem :: !LText  -- ^ Text describing what is the problem
40+
, kSolution :: !LText  -- ^ Text describing how to solve the issue
4241
} deriving (Show)
4342

4443
renderErrorCode :: ErrorCode -> Text

src/Regex.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ module Regex
1515
import Universum
1616

1717
import qualified Data.Array as Array
18-
import Data.Map.Strict (Map)
1918
import qualified Data.Map.Strict as Map
2019
import qualified Text.Regex.TDFA as TDFA
2120
import Text.Regex.TDFA.ByteString.Lazy (Regex)

src/Util.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ module Util
66
import Universum
77

88
import qualified Codec.Archive.Zip as Zip
9-
import Data.Map.Strict (Map)
109
import qualified Data.Map.Strict as Map
1110

1211
-- | Extract log file from given zip file

src/Zendesk.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ defaultConfig = Config 0 "https://iohk.zendesk.com" "" "daedalus-bug-reports@ioh
6363
knowledgebasePath :: FilePath
6464
knowledgebasePath = "./knowledgebase/knowledge.csv"
6565

66+
-- | Filepath to token file
6667
tokenPath :: FilePath
6768
tokenPath = "./tmp-secrets/token"
6869

70+
-- | Filepath to assign_to file
6971
assignToPath :: FilePath
7072
assignToPath = "./tmp-secrets/assign_to"
7173

0 commit comments

Comments
 (0)