hlint icon indicating copy to clipboard operation
hlint copied to clipboard

Amoral language

Open NorfairKing opened this issue 1 year ago • 7 comments

Fix #1584

I started by refactoring the relevant code, but in doing so I found some very strange semantics, as you'll see below. I assume this is a historical artifact of previous refactors but I'd appreciate a double-check first.

I couldn't figure out how to run the tests either, stack test doesn't seem to run any tests.

NorfairKing avatar May 08 '24 12:05 NorfairKing

Regarding running tests - https://github.com/ndmitchell/hlint#how-to-run-tests

googleson78 avatar May 08 '24 12:05 googleson78

@googleson78 Aha nice! I just did that and it passed:

Tests passed (956)

But I'd like to do a bit more refactoring because the current code is definitely strange.

NorfairKing avatar May 08 '24 13:05 NorfairKing

@ndmitchell what do you think?

NorfairKing avatar May 13 '24 18:05 NorfairKing

I think no-loaded language is always better. I think "You can remove it" might be the clearest of all? At this point we believe it is definitely safe to remove, so I don't think we need to equivocate. But we also don't need to preach. Does You can remove it strike the right balance? Telling you what is safe, but leaving it up to you to take action?

ndmitchell avatar Aug 26 '24 14:08 ndmitchell

I think no-loaded language is always better.

That sentence is so funny to me :P

I think "You can remove it" might be the clearest of all? At this point we believe it is definitely safe to remove, so I don't think we need to equivocate. But we also don't need to preach. Does You can remove it strike the right balance? Telling you what is safe, but leaving it up to you to take action?

I can make that change if you want, just let me know. I chose this wording because I've disagreed with hlint in the past and/or found bugs.

NorfairKing avatar Aug 26 '24 15:08 NorfairKing

While anything in HLint can have bugs, I think we broadly have to assume it's right in the messaging, or it just gets way too confusing.

ndmitchell avatar Aug 26 '24 16:08 ndmitchell

Reflecting on this further, I wonder if "Perhaps remove it" is the right balance? The perhaps turns it more into a dialog with the user - a suggestion. It doesn't suggest doubt in the validity of the hint, but it leaves all agency with the user?

Sorry for ratholing on the smallest things here @NorfairKing - genuinely curious what people think? I think this diff is definitely an improvement to the status quo, just wondering if more is even better?

ndmitchell avatar Sep 01 '24 10:09 ndmitchell