-
-
Notifications
You must be signed in to change notification settings - Fork 761
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
Rename Blacklist and Whitelist to be self explanatory #2778
Rename Blacklist and Whitelist to be self explanatory #2778
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2778 +/- ##
============================================
- Coverage 80.53% 80.53% -0.01%
- Complexity 2321 2324 +3
============================================
Files 386 386
Lines 6952 6955 +3
Branches 1260 1261 +1
============================================
+ Hits 5599 5601 +2
Misses 725 725
- Partials 628 629 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for taking the time to participate in an open source project!
I'm afraid, but I have to reject this PR for the following reasons.
With these changes, the user would need to migrate existing baseline files. This requires effort and hence costs time. You would need to explain this to the user. I see the newly created issues already coming.
Since detekt is also no small project anymore and the baseline feature is used quite often, this change affects a bigger group of users.
I would encourage you to reconsider! There is wider precedent for this, ietf has a great write-up here: https://tools.ietf.org/id/draft-knodel-terminology-00.html#rfc.section.1.2 Also: |
I understand the potential connotations of these words. I explicitly didn't negate that. I said that changes like this have an impact on users, clients and 3rd party contributors with custom domain-specific detekt extensions. I think that compatibility and long term support are very important for static code analyzers in order to foster user acceptance. Don't forget the users in this process. |
Thanks for the feedback. As mentioned in the OP it is quite easy to add backward compatibility. I just pushed a change that does that. |
In the docs it says this
I agree that This actually show that blacklist and whitelist might were bad names to begin with. a whitelist and a blacklist are opposites, one is traditionally used to include things and the other to exclude. In Detekt they are functionally doing the same thing. |
@remcomokveld thanks for pointing that out. What do you think of |
Hi, thanks for the discussion here. @schalkms @remcomokveld @ZacSweers the NCSC uses the terms allow and deny lists as @schalkms mentioned - https://inews.co.uk/news/government-cyber-experts-blacklist-whitelist-racism-fears-2840970 I like @remcomokveld names as they are describtive and capture my initial intent of the baseline sections. Open question: |
They would both be The only place where these lists are read is here detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/baseline/Baseline.kt Line 13 in 98b89f4
|
I vote for option 2 here. |
I agree with option 2 as well. The only thing that might be nice to add to this is a warning message when deprecated |
Thanks for the change @remcomokveld I also think that this is the opportunity to remove some of the confusion around the current baseline, and be more inclusive. As you already mentioned, Given that when running
I would argue against using As for the |
detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/baseline/BaselineHandler.kt
Outdated
Show resolved
Hide resolved
detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/baseline/Baseline.kt
Show resolved
Hide resolved
I like all three names. Lets go with |
I vote option 1. We will generate a bit of noise in git but all those users will have their baselines migrated so once they move to 2.0 it will just work. And thanks for the PR! |
Hm, well to be honest. If the user updates the detekt version he already has to create one commit. |
24e59fb
to
3e6d66a
Compare
detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/baseline/BaselineHandler.kt
Outdated
Show resolved
Hide resolved
detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/baseline/Baseline.kt
Outdated
Show resolved
Hide resolved
3e6d66a
to
9c95cde
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good on my end, thanks again for doing this ✊🏾
@arturbosch any clue what is causing the checks to fail now? I'm not seeing what exactly went wrong |
409d1ab
to
d37b9d8
Compare
</Blacklist> | ||
<Whitelist> | ||
</ManuallySuppressedIssues> | ||
<CurrentIssues> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not clear what means "CurrentIssues". Could you please find another name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. The context is ambiguous here. I might have some other "current" issues, which are not in the baseline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CurrentIssues without any context would indeed be confusing. In the context of a baseline file, however, I think that the name captures exactly what is intended. If you have a better name I'm open to suggestions though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm too late to the party, but I also think CurrentIssues is a very strange name, there was a previous comment to "avoid the concept of time", but "current" is all about time.
I think the relationship should be reinstated between the two type of ignore, that way you can infer the meaning of one by understanding the other.
Perhaps these'll be changed in the future or perhaps never again, here's my input anyway:
BaselineSuppressedIssues
ManuallySuppressedIssues
- blacklist code smells which are false positives | ||
- generate a baseline whitelist of code smells if your project is already old and has many smells, so only new | ||
- suppress code smells which are false positives | ||
- generate a baseline of code smells if your project is already old and has many smells, so only new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed world. baseline of what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider:
- generate a baseline list of code smells if your project is already old and has many smells, so only new
I second this. If tomorrow will bring another set of words considered inappropriate in the current momentum, would this mean all project should ignore their users and just blindly go on with whatever is demanded? Here's a good answer from an opensource project maintainer on a similar issue. |
@dimsuz I recognize the point you're trying to make regarding churn and making invasive changes for what you feel may be trivial reasons, and I appreciate your effort to engage in this honestly and from a position of pragmatism. If this were a significant breaking change, it would be valid to suggest waiting until a major release to change. If these came frequently, it could be valid to suggest being tactical about what changes are meaningful. In this specific PR however, there are no breaking changes. It is a free swing at doing something that is meaningful to a nontrivial number of users that do face endemic terminology like this every day. If social progress were as slippery of a slope as you're suggesting, we'd be in a much better place today than we are. That is not the case though, not yet. In light of that, we should aspire to embrace opportunities for progress in all its forms, whenever and if ever they arrive on our doorstep. |
I think it's been demonstrated in this thread that the meanings of blacklist and whitelist are not clear in detekt, and that the proposed names of "ManuallySuppressedIssues" and "CurrentIssues" capture the meanings more clearly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fully supporting this change! Code looks good from my side.
If everybody feels that sensitive to words they write once and forget and it's not a major breaking change for users then at least we need to find a good replacements. As I've already noted "CurrentIssues" is not a suitable one imo. I'm currently failing to come up with a good one though, maybe someone would? By the way, are you sure that these are non-breaking changes? If I have a |
In the parsing logic the old and the new tags are treated as synonyms. detekt/detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/baseline/BaselineHandler.kt Lines 17 to 19 in d37b9d8
There was also a test added which verifies that the old baseline format still parses correctly here detekt/detekt-core/src/test/kotlin/io/gitlab/arturbosch/detekt/core/baseline/BaselineFormatSpec.kt Lines 42 to 51 in d37b9d8
|
What about blockList, allowList? |
Both lists are "allowList". The only difference between them is that the values in |
Based on the reactions this seems to be a controversial change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my two comments and sorry for requesting changes again.
detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/baseline/BaselineHandler.kt
Outdated
Show resolved
Hide resolved
Judging by the amount of comments and emojis I see a clear trend towards changing these tags. I want to prepare a 1.10.0-RC1 release tonight. So if most are happy with |
This was done to make it more clear why they still exist in code
7ff4f8d
to
6d4f6fa
Compare
@schalkms anything else you see missing in this PR to get it merged? |
There's a merge conflict. Documentation has been updated as far as I can see. |
I originally started this exercise because I believe the terms blacklist and whitelist have racial connotations that are inappropriate to be used. But while trying to find new names I found that
SuppressedFalsePositive
andTemporarySuppressedIssues
actually describe much more accurately than the previous values.This PR would currently be a breaking change because existing baseline files would no longer work. If desired I think it would be possible to build in backward compatibility. However, I think the fact that this is a breaking change is a good thing because it will raise more awareness about the fact that blacklist and whitelist are really terms that we should all stop using.
Edit:
Updated the PR to not be a breaking change anymore. Existing baseline files with
<Blacklst>
and<Whitelist>
tags will still be supported, but newly generated baselines will useSuppressedFalsePositive
andTemporarySuppressedIssues
respectively.