ndmitchell / ndmitchell/hlint

Make some warnings more severe

Open
#679 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
1.6k
Forks
210
PR merge metrics
No merged PRs in 30d

Description

I think a few of our warnings need to be made more severe by default, in particular those where a non-fixed part of the expression is discarded, implying that the programmer meant something other than what the expression is actually equivalent to. For example, someone who writes sum (x,y,z) probably meant x+y+z even though it's really equivalent to just z. Similarly, someone who writes x <* pure True probably meant x *> pure True, even though it's really equivalent to just x. The common theme I see here is that if you ever get one of these, its meaning is probably less "this code can be simplified" and more "this code doesn't do what you think it does". What do you think of bumping these sorts of things up to errors, or maybe adding some "severe warning" entry in between warnings and errors, and also inhibiting refactor from automatically "fixing" them?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests; start by locating how HLint warning severity and automatic refactoring are defined, then trace the examples sum (x,y,z) and x <* pure True. Done requires an agreed policy for severe warnings or errors and whether refactoring should be inhibited.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.