Skip to content

Commit

Permalink
Fix the wrong hlint ci setting (#730)
Browse files Browse the repository at this point in the history
* Fix the wrong hlint ci setting

* Make hlint happy
  • Loading branch information
toku-sa-n authored May 3, 2023
1 parent 52eddfb commit ce45bf2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/static-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: haskell/actions/hlint-setup@14f59b6b6cfb9fec5e47296d6604e9c4e961a5b1 # v2.3.8

- name: Run HLint
uses: haskell/actions/hlint-setup@14f59b6b6cfb9fec5e47296d6604e9c4e961a5b1 # v2.3.8
uses: haskell/actions/hlint-run@14f59b6b6cfb9fec5e47296d6604e9c4e961a5b1 # v2.3.8
with:
path: .
fail-on: warning
Expand Down
3 changes: 0 additions & 3 deletions app/Main.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE Unsafe #-}

-- | Main entry point to hindent.
--
-- hindent
Expand Down
13 changes: 6 additions & 7 deletions src/HIndent/CabalFile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ packageStanzas pd =
BenchmarkExeV10 _ path -> [path]
_ -> []
in mconcat
[ maybeToList $ fmap libStanza $ library pd
, fmap exeStanza $ executables pd
, fmap testStanza $ testSuites pd
, fmap benchStanza $ benchmarks pd
[ maybeToList $ libStanza <$> library pd
, exeStanza <$> executables pd
, testStanza <$> testSuites pd
, benchStanza <$> benchmarks pd
]

-- | Find cabal files that are "above" the source path
Expand All @@ -100,7 +100,7 @@ findCabalFiles dir rel = do
[]
| dir == "/" -> return Nothing
[] -> findCabalFiles (takeDirectory dir) (takeFileName dir </> rel)
_ -> return $ Just (fmap (\n -> dir </> n) cabalnames, rel)
_ -> return $ Just (fmap (dir </>) cabalnames, rel)

getGenericPackageDescription :: FilePath -> IO (Maybe GenericPackageDescription)
#if MIN_VERSION_Cabal(2, 2, 0)
Expand Down Expand Up @@ -129,8 +129,7 @@ getCabalStanza srcpath = do
Just gpd -> do
return $ packageStanzas $ flattenPackageDescription gpd
return $
case filter (\stanza -> stanzaIsSourceFilePath stanza relpath) $
mconcat stanzass of
case filter (`stanzaIsSourceFilePath` relpath) $ mconcat stanzass of
[] -> Nothing
(stanza:_) -> Just stanza -- just pick the first one
Nothing -> return Nothing
Expand Down
1 change: 0 additions & 1 deletion src/HIndent/ModulePreprocessing/CommentRelocation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE ViewPatterns #-}

-- | Comment relocation for pretty-printing comments correctly.
--
Expand Down

0 comments on commit ce45bf2

Please sign in to comment.