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

Follow hlint suggestions. #513

Merged

Conversation

philderbeast
Copy link
Contributor

After the fix for #453 this PR fixes these 5 hlint warnings and suggestions.

> ./run hlint
Running: cabal --project-file=/.../wasp/waspc/dev-tool.project install hlint
  --installdir=/.../wasp/waspc/.bin
  --install-method=copy
  --overwrite-policy=always
&& /.../wasp/waspc/.bin/hlint .

Resolving dependencies...
Up to date
Copying 'hlint' to
'/.../wasp/waspc/.bin/hlint'
src/Wasp/Analyzer/Type.hs:43:38-88: Suggestion: Move brackets to avoid $
Found:
  (intercalate ", " $ show <$> (t1 : t2 : ts)) ++ ")"
Perhaps:
  intercalate ", " (show <$> (t1 : t2 : ts)) ++ ")"

src/Wasp/Analyzer/Evaluator/EvaluationError.hs:1:1-27: Warning: Unused LANGUAGE pragma
Found:
  {-# LANGUAGE LambdaCase #-}
Perhaps you should remove it.

src/Wasp/Analyzer/TypeChecker/TypeError.hs:1:1-27: Warning: Unused LANGUAGE pragma
Found:
  {-# LANGUAGE LambdaCase #-}
Perhaps you should remove it.

test/AppSpec/ValidTest.hs:(62,13)-(71,17): Warning: Redundant lambda
Found:
  makeSpec
    = \ appAuth pageAuthRequired
        -> basicAppSpec
             {AS.decls = [AS.Decl.makeDecl "TestApp"
                            $ basicApp {AS.App.auth = appAuth},
                          AS.Decl.makeDecl "TestPage"
                            $ basicPage {AS.Page.authRequired = pageAuthRequired},
                          AS.Decl.makeDecl userEntityName validUserEntity]}
Perhaps:
  makeSpec appAuth pageAuthRequired
    = basicAppSpec
        {AS.decls = [AS.Decl.makeDecl "TestApp"
                       $ basicApp {AS.App.auth = appAuth},
                     AS.Decl.makeDecl "TestPage"
                       $ basicPage {AS.Page.authRequired = pageAuthRequired},
                     AS.Decl.makeDecl userEntityName validUserEntity]}

test/AppSpec/ValidTest.hs:(85,13)-(92,17): Warning: Redundant lambda
Found:
  makeSpec
    = \ appAuth userEntity
        -> basicAppSpec
             {AS.decls = [AS.Decl.makeDecl "TestApp"
                            $ basicApp {AS.App.auth = appAuth},
                          AS.Decl.makeDecl userEntityName (userEntity :: AS.Entity.Entity)]}
Perhaps:
  makeSpec appAuth userEntity
    = basicAppSpec
        {AS.decls = [AS.Decl.makeDecl "TestApp"
                       $ basicApp {AS.App.auth = appAuth},
                     AS.Decl.makeDecl userEntityName (userEntity :: AS.Entity.Entity)]}

5 hints

Copy link
Member

@Martinsos Martinsos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for fixing this :)!

@Martinsos Martinsos merged commit 08704f4 into wasp-lang:main Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants