Description
Is your enhancement request related to a problem? Please describe.
It appears that the hls-stan-plugin
doesn't respect the configuration directives in a .stan.toml
file in the root of my project.
I have a stack.yaml-based Haskell project with multiple packages. I have a .stan.toml
file in the root of my project that looks like the following:
.stan.toml
:
[[check]]
type = "Exclude"
id = "STAN-0213"
scope = "all"
I'm expecting that this disables the STAN-0213
check (which warns about pattern matching on _
) when running stan
.
However, if I explicitly run HLS on a given Haskell file in my repo, it still warns about STAN-0213
:
$ haskell-language-server-wrapper typecheck ./src/path/to/MyModule.hs
...
File:
./src/path/to/MyModule.hs
Hidden: no
Range: 69:9-69:21
Source: stan
Severity: DiagnosticSeverity_Hint
Message:
✲ Name: Anti-pattern: Pattern matching on '_'
✲ Description: Pattern matching on '_' for sum types can create maintainability issues
✲ Severity: Warning
✲ Category: #AntiPattern
Possible solutions:
- Pattern match on each constructor explicitly
- Add meaningful names to holes, e.g. '_anyOtherFailure'
Describe the solution you'd like
I would expect that a .stan.toml
file in the root of my project affects the warnings that the hls-stan-plugin
shows.
Describe alternatives you've considered
I haven't considered any alternatives.
However, this is the first time I've messed around with stan
, so I'm not 100% sure I'm configuring it properly. I haven't been able to figure out how to get the standalone stan
executable to work properly, so it is possible this is just a stan
issue and not HLS-related.
I've looked through the following documentation for stan
:
- https://github.com/kowainik/stan/blob/main/README.md
- https://hackage.haskell.org/package/stan-0.0.0.0/docs/Stan-Config.html#g:5
Additional context
I'm using the following versions of the tools:
- HLS 2.5.0.0
- GHC 9.4.8
- (I think HLS-2.5.0.0 is compiled against stan-0.1.0.2, but I haven't been able to confirm that)