[jira] [Commented] (HADOOP-12301) Fix some test-patch plugins to count the diff lines correctly

2015-08-22 Thread Kengo Seki (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-12301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14708080#comment-14708080
 ] 

Kengo Seki commented on HADOOP-12301:
-

A pylint example. In this case, new pylint issues should be 6, but counted as 
10 incorrectly.

{code}
| Vote |  Subsystem |  Runtime   | Comment

|  -1  |pylint  |  0m 05s| The applied patch generated 10 new 
|  ||| pylint issues (total was 437, now 447).


|| Subsystem || Report/Notes ||

| pylint | v1.4.4 |
| pylint | /private/tmp/test-patch-hadoop/40919/diff-patch-pylint.txt |


[sekikn@mobile hadoop]$ cat 
/private/tmp/test-patch-hadoop/40919/diff-patch-pylint.txt
dev-support/releasedocmaker.py:584: [W0311(bad-indentation), ] Bad indentation. 
Found 4 spaces, expected 2
dev-support/releasedocmaker.py:584: [C0326(bad-whitespace), ] No space allowed 
after bracket
( ( ) )
^
dev-support/releasedocmaker.py:584: [C0326(bad-whitespace), ] No space allowed 
after bracket
( ( ) )
  ^
dev-support/releasedocmaker.py:584: [C0326(bad-whitespace), ] No space allowed 
before bracket
( ( ) )
^
dev-support/releasedocmaker.py:584: [C0326(bad-whitespace), ] No space allowed 
before bracket
( ( ) )
  ^
dev-support/releasedocmaker.py:584: [W0104(pointless-statement), ] Statement 
seems to have no effect
[sekikn@mobile hadoop]$ 
{code}


> Fix some test-patch plugins to count the diff lines correctly
> -
>
> Key: HADOOP-12301
> URL: https://issues.apache.org/jira/browse/HADOOP-12301
> Project: Hadoop Common
>  Issue Type: Sub-task
>  Components: yetus
>Affects Versions: HADOOP-12111
>Reporter: Kengo Seki
>
> 1. rubocop.sh counts only lines which have at least five fields separated by 
> a colon:
> {code}
>   calcdiffs "${PATCH_DIR}/branch-rubocop-result.txt" 
> "${PATCH_DIR}/patch-rubocop-result.txt" > 
> "${PATCH_DIR}/diff-patch-rubocop.txt"
>   diffPostpatch=$(${AWK} -F: 'BEGIN {sum=0} 4 "${PATCH_DIR}/diff-patch-rubocop.txt")
>   if [[ ${diffPostpatch} -gt 0 ]] ; then
> # shellcheck disable=SC2016
> numPrepatch=$(${AWK} -F: 'BEGIN {sum=0} 4 "${PATCH_DIR}/branch-rubocop-result.txt")
> # shellcheck disable=SC2016
> numPostpatch=$(${AWK} -F: 'BEGIN {sum=0} 4 "${PATCH_DIR}/patch-rubocop-result.txt")
> {code}
> This is because the diff result can contain multiple lines for one issue. For 
> example:
> {code}
> [sekikn@mobile hadoop]$ cat 
> /private/tmp/test-patch-hbase/25821/diff-patch-rubocop.txt
> bin/draining_servers.rb:165:1: C: Do not introduce global variables.
> $foo
> 
> {code}
> Checking the number of fields is intended to skip the second and third lines 
> in the above diff file. But four or more colons can appear in the source code 
> itself, for example:
> {code}
> | Vote |   Subsystem |  Runtime   | Comment
> 
> |  -1  |rubocop  |  0m 02s| The applied patch generated 4 new 
> |  | || rubocop issues (total was 77, now 81).
> || Subsystem || Report/Notes ||
> 
> | rubocop | v0.32.1 |
> | rubocop | /private/tmp/test-patch-hbase/5632/diff-patch-rubocop.txt |
> [sekikn@mobile hadoop]$ cat 
> /private/tmp/test-patch-hbase/5632/diff-patch-rubocop.txt
> bin/draining_servers.rb:165:4: C: Do not use :: for method calls.
> foo::bar::baz
>^^
> bin/draining_servers.rb:165:9: C: Do not use :: for method calls.
> foo::bar::baz
> ^^
> [sekikn@mobile hadoop]$ 
> {code}
> In this case, new rubocop issues should be 2, but counted as 4 incorrectly. 
> More reliable way to count is needed.
> 2. pylint.sh has the same problem. In addition, I removed awk's '-F:' option 
> by mistake on HADOOP-12286. It can report a wrong number for now.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (HADOOP-12301) Fix some test-patch plugins to count the diff lines correctly

2015-08-22 Thread Kengo Seki (JIRA)

[ 
https://issues.apache.org/jira/browse/HADOOP-12301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14708070#comment-14708070
 ] 

Kengo Seki commented on HADOOP-12301:
-

I misunderstood ruby-lint output. It outputs only one line for one issue (I ran 
ruby-lint against all of the .rb files under HBase and confirmed it) and the 
current implementation is reasonable. I edited JIRA description so as to 
reflect reality.

> Fix some test-patch plugins to count the diff lines correctly
> -
>
> Key: HADOOP-12301
> URL: https://issues.apache.org/jira/browse/HADOOP-12301
> Project: Hadoop Common
>  Issue Type: Sub-task
>  Components: yetus
>Affects Versions: HADOOP-12111
>Reporter: Kengo Seki
>
> 1. rubocop.sh counts only lines which have at least five fields separated by 
> a colon:
> {code}
>   calcdiffs "${PATCH_DIR}/branch-rubocop-result.txt" 
> "${PATCH_DIR}/patch-rubocop-result.txt" > 
> "${PATCH_DIR}/diff-patch-rubocop.txt"
>   diffPostpatch=$(${AWK} -F: 'BEGIN {sum=0} 4 "${PATCH_DIR}/diff-patch-rubocop.txt")
>   if [[ ${diffPostpatch} -gt 0 ]] ; then
> # shellcheck disable=SC2016
> numPrepatch=$(${AWK} -F: 'BEGIN {sum=0} 4 "${PATCH_DIR}/branch-rubocop-result.txt")
> # shellcheck disable=SC2016
> numPostpatch=$(${AWK} -F: 'BEGIN {sum=0} 4 "${PATCH_DIR}/patch-rubocop-result.txt")
> {code}
> This is because the diff result can contain multiple lines for one issue. For 
> example:
> {code}
> [sekikn@mobile hadoop]$ cat 
> /private/tmp/test-patch-hbase/25821/diff-patch-rubocop.txt
> bin/draining_servers.rb:165:1: C: Do not introduce global variables.
> $foo
> 
> {code}
> Checking the number of fields is intended to skip the second and third lines 
> in the above diff file. But four or more colons can appear in the source code 
> itself, for example:
> {code}
> | Vote |   Subsystem |  Runtime   | Comment
> 
> |  -1  |rubocop  |  0m 02s| The applied patch generated 4 new 
> |  | || rubocop issues (total was 77, now 81).
> || Subsystem || Report/Notes ||
> 
> | rubocop | v0.32.1 |
> | rubocop | /private/tmp/test-patch-hbase/5632/diff-patch-rubocop.txt |
> [sekikn@mobile hadoop]$ cat 
> /private/tmp/test-patch-hbase/5632/diff-patch-rubocop.txt
> bin/draining_servers.rb:165:4: C: Do not use :: for method calls.
> foo::bar::baz
>^^
> bin/draining_servers.rb:165:9: C: Do not use :: for method calls.
> foo::bar::baz
> ^^
> [sekikn@mobile hadoop]$ 
> {code}
> In this case, new rubocop issues should be 2, but counted as 4 incorrectly. 
> More reliable way to count is needed.
> 2. pylint.sh has the same problem. In addition, I removed awk's '-F:' option 
> by mistake on HADOOP-12286. It can report a wrong number for now.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)