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
Use String#isEmpty
where possible
#7690
Conversation
Please provide some information about what this plugin is, what it does and most notably, why it should be considered. Thanks. |
Cleanthat is a spotless-plugin enabling automatic linting of Java code. Automatic linting enables leaner code (similarly to formatting, but extended to semantic changes). I suggest integrating it in JenkinsCI as jenkinsCI already integrates Spotless, which makes Cleanthat integration very easy. The initial suggested set of mutators of SafeAndConsensual which applies safe and consensual changes like :
|
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.
On the "pro" side of things, the code changes here look mildly useful and I'm confident we'd integrate them without introduction of Cleanthat into the build.
There are a few things in the "con" column though:
- Your own lack of confidence.
- The lack of justification provided. We have PR templates for a reason.
- Apparent lack of project popularity (both users and contributors). Unfortunately this is something we have to consider in terms of long-term viability of our dependencies. In this case, it appears there are no contributors besides you and GH indicator of user popularity are also fairly low.
Overall this doesn't seem to bring enough benefit to offset the (fairly minor overall, but still) potential drawbacks.
I would be happy to activate less consensual mutators (or get feedbacks about mutators yet-to-implement which would fit your needs.
The point here is, like for formatting, to get this done automatically on any PR. Not requiring to apply them when you think about them (would the changes be simple or complex).
Cleanthat is definitely in early stage, and looking for a broader audience. One project may encounter issues, while others would not. I open this PR after checking by myself Cleanthat runs smoothly in your project.
Sorry for that. I should have comply to the guidelines. I'll update the initial comment ASAP. (Looking into this, fact is the template did not appear in when I open the PR, for any unknown reason).
Yes, definitely. However, I'd like to stress-out this is not a Runtime-dependency, but a build-time side-wheel dependency. Would cleanthat project die, and would you decide to drop it from JenkinsCI, you could do that by dropping the lint-option without impacting any users.
I totally get your train of thoughts. I would be happy to get feedback from relevant linting rules you could expect from such a rule. More mutators are available (see MUTATORS.MD ) and I would be happy to implement some following your specific needs. |
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.
While the underlying changes could be considered as code cleanup, but the first release of this plugin happened close to 2 months ago. Hence, I believe it's still in its early stages.
I believe, I could consider an addition at a later point, when more people in real-world projects started to use this plugin, and it offers broader functionality. I don't think the plugin offers enough value to add it to this repository at this point.
Thanks a lot for the consideration.
There is various available rules, which I did not activated in this PR for the sake of sticking to consensual changes. Anyway, coming functionalities may appear more interesting (like automatic refactoring, or covering more patterns, or converting more patterns to Stream API).
If I may ask, do you have specific features related to Cleanthat proposal which may appear useful ? (e.g. converting some code manipulating a |
Please take a moment and address the merge conflicts of your pull request. Thanks! |
String#isEmpty
where possible
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.
The consensus among the Jenkins core maintainers is that we are not interested in adopting this tool. I have retained the String#isEmpty
portions of this PR, as they have value as an independent cleanup. I have reverted everything related to Cleanthat. With that, this PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback. Please see the merge process documentation for more information about the merge process. Thanks!
Suggestion: Add Cleanthat as Spotless plugin
Like Spotless is used to format automatically the code-base, I suggest activating Cleanthat as a Spotless plugin to apply linting-rules.
The proposed set of mutators is restricted to safe and consensual ones:
Cleanthat changelog: CHANGES.MD
Testing done
No tests done. I reviewed the changes, which looks very safe.
Proposed changelog entries
Proposed upgrade guidelines
N/A
Submitter checklist
@Restricted
or have@since TODO
Javadocs, as appropriate.@Deprecated(since = "TODO")
or@Deprecated(forRemoval = true, since = "TODO")
, if applicable.eval
to ease future introduction of Content Security Policy (CSP) directives (see documentation).Desired reviewers
?
Maintainer checklist
Before the changes are marked as
ready-for-merge
:upgrade-guide-needed
label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).lts-candidate
to be considered (see query).