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

Amoral language #1591

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

NorfairKing
Copy link

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.

@googleson78
Copy link
Contributor

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

@NorfairKing
Copy link
Author

@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 NorfairKing changed the title WIP: Amoral language Amoral language May 9, 2024
@NorfairKing
Copy link
Author

@ndmitchell what do you think?

@ndmitchell
Copy link
Owner

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?

@NorfairKing
Copy link
Author

NorfairKing commented Aug 26, 2024

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.

@ndmitchell
Copy link
Owner

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.

hints.md Outdated
@@ -249,7 +249,7 @@ Found:
<br>
Suggestion:
<code>
Perhaps you should remove it.
You may be able to remove it.
Copy link
Contributor

Choose a reason for hiding this comment

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

Simplifying to You can remove it was my immediate thought too, FWIW

@ndmitchell
Copy link
Owner

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?

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.

Consider using less morally-loaded language in hints.
4 participants