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

#981 Text: Before and After #1014

Merged
merged 5 commits into from
Feb 2, 2019
Merged

#981 Text: Before and After #1014

merged 5 commits into from
Feb 2, 2019

Conversation

BinaryIgor
Copy link
Contributor

@BinaryIgor BinaryIgor commented Jan 15, 2019

Two new classes with tests as described in #981 using new naming convention discussed in #913(ARC comment).

@0crat 0crat added the scope label Jan 15, 2019
@0crat
Copy link
Collaborator

0crat commented Jan 15, 2019

Job #1014 is now in scope, role is REV

@codecov-io
Copy link

codecov-io commented Jan 15, 2019

Codecov Report

Merging #1014 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1014      +/-   ##
============================================
+ Coverage      87.6%   87.65%   +0.04%     
- Complexity     1518     1524       +6     
============================================
  Files           265      267       +2     
  Lines          3889     3903      +14     
  Branches        213      215       +2     
============================================
+ Hits           3407     3421      +14     
  Misses          433      433              
  Partials         49       49
Impacted Files Coverage Δ Complexity Δ
src/main/java/org/cactoos/text/SuffixOf.java 100% <100%> (ø) 3 <3> (?)
src/main/java/org/cactoos/text/PrefixOf.java 100% <100%> (ø) 3 <3> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e9d788...3abfb4c. Read the comment docs.

@0crat
Copy link
Collaborator

0crat commented Jan 15, 2019

This pull request #1014 is assigned to @victornoel/z, here is why; the budget is 15 minutes, see §4; please, read §27 and when you decide to accept the changes, inform @llorllale/z (the architect) right in this ticket; if you decide that this PR should not be accepted ever, also inform the architect; this blog post will help you understand what is expected from a code reviewer; there will be no monetary reward for this job

Copy link
Collaborator

@victornoel victornoel left a comment

Choose a reason for hiding this comment

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

@Iprogrammerr see my comments

*/
@SuppressWarnings({"PMD.CallSuperInConstructor",
"PMD.ConstructorOnlyInitializesOrCallOtherConstructors"})
public After(final String text, final String boundary) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Iprogrammerr is the casting really needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@victornoel Without that build will not pass. I do not why, I see nothing wrong with this constructor.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Iprogrammerr ok, I suppose it is because of yegor256/qulice#887 and PMD doesn't see the call to super. Let's leave it then

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Iprogrammerr qulice 0.18.10 was released with a fix for this, can you see if upgrading qulice enables you to remove those suppresswarnings.
If it introduces too much work on other parts of the code, then add a @todo at the top of this class to upgrade qulice AND remove both the suppresswarnings in Before and in After please.

@SuppressWarnings({"PMD.CallSuperInConstructor",
"PMD.ConstructorOnlyInitializesOrCallOtherConstructors"})
public Before(final String text, final String boundary) {
super((Scalar<String>) () -> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Iprogrammerr is the casting really needed?

*/
@Test
public void returnsEmptyIfThereIsNoBoundary() {
MatcherAssert.assertThat(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Iprogrammerr please use cactoos-matchers Assertion

*/
@Test
public void returnsEmptyIfStringIsBoundary() {
MatcherAssert.assertThat(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Iprogrammerr please use cactoos-matchers Assertion

*/
@Test
public void returnsAfterBoundaryString() {
MatcherAssert.assertThat(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Iprogrammerr please use cactoos-matchers Assertion

*/
@Test
public void returnsInputIfThereIsNoBoundary() {
MatcherAssert.assertThat(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Iprogrammerr please use cactoos-matchers Assertion

*/
@Test
public void returnsEmptyIfStringIsBoundary() {
MatcherAssert.assertThat(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Iprogrammerr please use cactoos-matchers Assertion

*/
@Test
public void returnsBeforeBoundaryString() {
MatcherAssert.assertThat(
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Iprogrammerr please use cactoos-matchers Assertion

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@victornoel Let's wait for #1023 then.

* @param text Text representing the text value
* @param boundary String after which text will be split
*/
@SuppressWarnings({"PMD.CallSuperInConstructor",
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Iprogrammerr I'm surprised this is needed, can you confirm it is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@victornoel Yes, I was too. I do not know what qulice does not like there.

* @param text Text representing the text value
* @param boundary String to which text will be split
*/
@SuppressWarnings({"PMD.CallSuperInConstructor",
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Iprogrammerr I'm surprised this is needed, can you confirm it is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@victornoel Same as above.

@victornoel
Copy link
Collaborator

@Iprogrammerr ping :)

@BinaryIgor
Copy link
Contributor Author

@victornoel Warnings need to be suppressed as I have described. As far as replacing MatcherAssert we need to wait for #1023.

@victornoel
Copy link
Collaborator

@Iprogrammerr the PR to upgrade cactoos-matchers to 0.13 was merged (#1027 where you forgot to remove the puzzle, so the issue is still open…)

@llorllale
Copy link
Contributor

@victornoel the issue for PR #1027, #1023, is not a puzzle. @Iprogrammerr should ask the reporter to close it.

@victornoel
Copy link
Collaborator

@llorllale ah yes, good point ^^ got lost in all those microtasks :P anyway, this means that @Iprogrammerr you are no longer blocked and can fix the comments in this PR (and the others blocked by #1023)

@BinaryIgor
Copy link
Contributor Author

BinaryIgor commented Jan 25, 2019

@victornoel Tests are refactored. I have left a puzzle to update qulice, because this is how my attempt to do it ended:
no

@@ -31,6 +31,9 @@
* <p>There is no thread-safety guarantee.
*
* @since 1.0
* @todo #981:30min Update qulice version and remove
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Iprogrammerr please specify the minimum required version of qulice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@victornoel Done.

@victornoel
Copy link
Collaborator

@llorllale I think it's good to merge now

@llorllale
Copy link
Contributor

@Iprogrammerr @victornoel I think I'm going to stick with this decision for now (delay upgrading qulice). I'm OK with leaving any suppressions so long as no dependencies are required for our production code.

Therefore, @Iprogrammerr can you please remove that puzzle?

@llorllale
Copy link
Contributor

@Iprogrammerr can we rename Before and After to PrefixOf and SuffixOf respectively?

Let's not forget to rename the test files as well.

@BinaryIgor
Copy link
Contributor Author

BinaryIgor commented Jan 28, 2019

@llorllale Done. Travis does not like commits from the past, same as #1026.

@victornoel
Copy link
Collaborator

@Iprogrammerr maybe you should rebase on master

@BinaryIgor
Copy link
Contributor Author

@victornoel No, it is the same.

@victornoel
Copy link
Collaborator

@Iprogrammerr if I look at all the commits of this PR (https://github.com/yegor256/cactoos/pull/1014/commits) I see many commits with incorrect formatting of the message.
You must fix them all, not only the last one.

@BinaryIgor
Copy link
Contributor Author

@victornoel Back then, this rule does not exist.

@victornoel
Copy link
Collaborator

@victornoel Back then, this rule does not exist.

@Iprogrammerr so what? the purpose of the rule is to test your whole PR so that it conforms to expected quality. It's the problem of the PR creator to ensure it is mergeable.

@BinaryIgor
Copy link
Contributor Author

@victornoel You are right, but something else is wrong. Look at #1049. Travis error is the same, but there is only one new commit. It stops at commit with message "(#1030) ComparableText is not equal to the same text (extends TestEnvelope)" which was merged a few days ago.

@victornoel
Copy link
Collaborator

@Iprogrammerr open a new issue to get this bug solved

@BinaryIgor
Copy link
Contributor Author

@victornoel You are right, here it is #1050.

@llorllale
Copy link
Contributor

@Iprogrammerr can you please rebase on master?

@BinaryIgor
Copy link
Contributor Author

@llorllale Done.

@llorllale
Copy link
Contributor

@rultor merge

@rultor
Copy link
Collaborator

rultor commented Feb 2, 2019

@rultor merge

@llorllale OK, I'll try to merge now. You can check the progress of the merge here

@rultor rultor merged commit 3abfb4c into yegor256:master Feb 2, 2019
@rultor
Copy link
Collaborator

rultor commented Feb 2, 2019

@rultor merge

@llorllale Done! FYI, the full log is here (took me 14min)

@BinaryIgor BinaryIgor deleted the 981 branch February 2, 2019 14:45
@0crat 0crat removed the scope label Feb 2, 2019
@0crat
Copy link
Collaborator

0crat commented Feb 2, 2019

Code review was too long (17 days), architects (@llorllale) were penalized, see §55

@0crat
Copy link
Collaborator

0crat commented Feb 2, 2019

The job #1014 is now out of scope

@0crat
Copy link
Collaborator

0crat commented Feb 2, 2019

Order was finished: +15 point(s) just awarded to @victornoel/z

@0crat
Copy link
Collaborator

0crat commented Feb 2, 2019

Payment to ARC for a closed pull request, as in §28: +10 point(s) just awarded to @llorllale/z

@llorllale llorllale mentioned this pull request Apr 2, 2019
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.

7 participants