Skip to content

hlint fixity issues #2418

Closed
Closed
@ivan-m

Description

@ivan-m

Your environment

Which OS do you use: Red Hat 7 VM
Which lsp-client do you use: Emacs
Describe your project (alternative: link to the project): Shake + Stack; internal project so can't be shared

Steps to reproduce

# .hlint.yaml
- fixity: "infixl 3 <!>"

Haskell source file:

-- https://hackage.haskell.org/package/semigroupoids-5.3.6/docs/Data-Functor-Alt.html
import Data.Functor.Alt ((<!>))

-- Simplified function matching behaviour of actual functions
foo :: Char -> Maybe Int -> Maybe String
foo c mInt =
      show <$> mInt
  <!> pure <$> Just c

-- Note the relative fixities here: this is equivalent to: (...) <!> (...)

Load this in $EDITOR, list all suggestions from hls.

Expected behaviour

No warnings related to foo.

Actual behaviour

Functor law
 Found:
   show <$> mInt <!> pure <$> Just c
 Why not:
   show . (mInt <!> pure) <$> Just c

Include debug information

Running hlint explicitly does not have any problems.

The .hlint.yaml file is indeed being picked up by the hls hlint plugin as other suggestions are appearing based upon the configuration (custom linting rules, etc.). As such, this might be due to ndmitchell/hlint#1232

haskell-language-server-wrapper --debug . output only partially shown as it's quite large:

haskell-language-server version: 1.5.1.0 (GHC: 8.10.7) (PATH: /home/<elided>/haskell-language-server) (GIT hash: 1d82c8ec31628fc84f0ffe55ff572602212e07a2)
 ghcide setup tester in /home/<elided>
Report bugs at https://github.com/haskell/haskell-language-server/issues

Step 1/4: Finding files to test in /home/<elided>
Found 16145 files

Logs from LSP client:

Command "~/<elided>/haskell-language-server --lsp" is present on the path.
Command "~/<elided>/haskell-language-server --lsp" is present on the path.
Found the following clients for /path/to/Module.hs: (server-id lsp-haskell, priority 0)
The following clients were selected based on priority: (server-id lsp-haskell, priority 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: hls-hlint-plugintype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions