main :: IO ()
main = do
  pwd <- getCurrentDirectory
  let runHlint f = hlint $ f:
        [ "--ignore=Redundant do"
        , "--ignore=Use camelCase"
        , "--ignore=Redundant $"
        , "--ignore=Use &&"
        , "--ignore=Use &&&"
        , "--ignore=Use const"
        , "--ignore=Use >=>"
        , "--ignore=Use ."
        , "--ignore=Use unless"
        , "--ignore=Reduce duplication"
        , "--cpp-define=USE_TEMPLATE_HASKELL"
        , "--cpp-define=DEBUG"
        , "--ignore=Use tuple-section"
        ]
      recurseInto = and <$> sequence
        [ fileType ==? Directory
        , fileName /=? ".git"
        ]
      matchFile = and <$> sequence
        [ extension ==? ".hs"
        ]
  files <- find recurseInto matchFile (pwd </> "src") --TODO: Someday fix all hints in tests, etc.
  ideas <- fmap concat $ forM files $ \f -> do
    putStr $ "linting file " ++ drop (length pwd + 1) f ++ "... "
    runHlint f
  if null ideas then exitSuccess else exitFailure
main :: IO ()
main = do
  pwd <- getCurrentDirectory
  let runHlint f = hlint $ f:
        [ "--ignore=Redundant do"
        , "--ignore=Use camelCase"
        , "--ignore=Redundant $"
        , "--ignore=Use &&"
        , "--ignore=Use &&&"
        , "--ignore=Use const"
        , "--ignore=Use >=>"
        , "--ignore=Use ."
        , "--ignore=Use unless"
        , "--ignore=Reduce duplication"
        , "--cpp-define=USE_TEMPLATE_HASKELL"
        , "--cpp-define=DEBUG"
        , "--ignore=Use tuple-section"
        ]
      recurseInto = and <$> sequence
        [ fileType ==? Directory
        , fileName /=? ".git"
        ]
      matchFile = and <$> sequence
        [ extension ==? ".hs"
        ]
  files <- find recurseInto matchFile (pwd </> "src") --TODO: Someday fix all hints in tests, etc.
  ideas <- fmap concat $ forM files $ \f -> do
    putStr $ "linting file " ++ drop (length pwd + 1) f ++ "... "
    runHlint f
  if null ideas then exitSuccess else exitFailure
main = do
  pwd <- getCurrentDirectory
  let runHlint f = hlint $ f:
        [ "--ignore=Redundant do"
        , "--ignore=Use camelCase"
        , "--ignore=Redundant $"
        , "--ignore=Use &&"
        , "--ignore=Use &&&"
        , "--ignore=Use const"
        , "--ignore=Use >=>"
        , "--ignore=Use ."
        , "--ignore=Use unless"
        , "--ignore=Reduce duplication"
        , "--cpp-define=USE_TEMPLATE_HASKELL"
        , "--cpp-define=DEBUG"
        , "--ignore=Use tuple-section"
        ]
      recurseInto = and <$> sequence
        [ fileType ==? Directory
        , fileName /=? ".git"
        ]
      matchFile = and <$> sequence
        [ extension ==? ".hs"
        ]
  files <- find recurseInto matchFile (pwd </> "src") --TODO: Someday fix all hints in tests, etc.
  ideas <- fmap concat $ forM files $ \f -> do
    putStr $ "linting file " ++ drop (length pwd + 1) f ++ "... "
    runHlint f
  if null ideas then exitSuccess else exitFailure