Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the wrong hlint ci setting #730

Merged
merged 2 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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