Reviewed remaining hlint rules.

This commit is contained in:
Martin Sosic 2021-11-17 12:24:39 +01:00
parent 89c9d6a1db
commit ff2543b42f
3 changed files with 9 additions and 10 deletions

View File

@ -6,11 +6,8 @@
- -XQuasiQuotes
- -XScopedTypeVariables
# TODO: Review the remaining ignored hlint rules.
- ignore: {name: Use camelCase}
- ignore: {name: Eta reduce}
- ignore: {name: Use first}
- ignore: {name: Use second}
- ignore: {name: Use newtype instead of data}
- ignore: {name: Use $>}
- ignore: {name: Use list comprehension}
- ignore: {name: Use camelCase} # We can decide this on our own.
- ignore: {name: Eta reduce} # We can decide this on our own.
- ignore: {name: Use newtype instead of data} # We can decide this on our own.
- ignore: {name: Use $>} # I find it makes code harder to read if enforced.
- ignore: {name: Use list comprehension} # We can decide this on our own.

View File

@ -5,6 +5,7 @@ module Wasp.Generator.PackageJsonGenerator
)
where
import Data.Bifunctor (second)
import Data.List (find, intercalate)
import Data.Maybe (fromJust, isJust)
import qualified Wasp.NpmDependency as ND
@ -31,7 +32,7 @@ resolveNpmDeps waspDeps userDeps =
where
conflictingUserDeps :: [(ND.NpmDependency, NpmDependenciesConflictError)]
conflictingUserDeps =
map (\(dep, err) -> (dep, fromJust err)) $
map (second fromJust) $
filter (isJust . snd) $
map (\dep -> (dep, checkIfConflictingUserDep dep)) userDeps

View File

@ -12,6 +12,7 @@ where
import Control.Monad.State
import qualified Data.Aeson as Aeson
import Data.Bifunctor (first)
import Data.Text (Text, pack)
import Fixtures (systemSPRoot)
import StrongPath (Abs, Dir, File', Path', Rel, reldir, (</>))
@ -71,7 +72,7 @@ instance MonadIO MockWriteableMonad where
liftIO = undefined
modifyLogs :: MonadState (a, b) m => (a -> a) -> m ()
modifyLogs f = modify (\(logs, config) -> (f logs, config))
modifyLogs f = modify (first f)
newtype MockWriteableMonad a = MockWriteableMonad
{ unMockWriteableMonad :: State (MockWriteableMonadLogs, MockWriteableMonadConfig) a