[
https://issues.apache.org/jira/browse/HADOOP-12286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kengo Seki updated HADOOP-12286:
--------------------------------
Attachment: HADOOP-12286.HADOOP-12111.00.patch
Attaching a patch. To make this modification more generic, I implemented
PYLINT_OPTIONS instead of PYLINT_INDENT_STRING.
--indent-string no longer exists in pylint.sh, but the test patch succeeds
because it is defined in hadoop personality as PYLINT_OPTIONS:
{code}
[sekikn@mobile hadoop]$ grep indent-string dev-support/test-patch.d/pylint.sh
[sekikn@mobile hadoop]$ cat /tmp/test.patch
diff --git a/dev-support/shelldocs.py b/dev-support/shelldocs.py
index fc7601a..96363a0 100755
--- a/dev-support/shelldocs.py
+++ b/dev-support/shelldocs.py
@@ -268,4 +268,4 @@ def main():
if __name__ == "__main__":
main()
-
+ print
[sekikn@mobile hadoop]$ dev-support/test-patch.sh
--basedir=/Users/sekikn/dev/hadoop --project=hadoop /tmp/test.patch
(snip)
| Vote | Subsystem | Runtime | Comment
============================================================================
| +1 | @author | 0m 00s | The patch does not contain any @author
| | | | tags.
| +1 | asflicense | 0m 22s | Patch does not generate ASF License
| | | | warnings.
| +1 | pylint | 0m 03s | There were no new pylint issues.
| +1 | whitespace | 0m 00s | Patch has no whitespace issues.
| | | 0m 26s |
{code}
Without PYLINT_OPTIONS, this patch fails because the default indent is 4
whitespaces:
{code}
[sekikn@mobile hadoop]$ grep PYLINT_OPTIONS dev-support/personality/hadoop.sh
PYLINT_OPTIONS="--indent-string=' '"
[sekikn@mobile hadoop]$ sed -i -e 's/\(PYLINT_OPTIONS\)/#\1/'
dev-support/personality/hadoop.sh
[sekikn@mobile hadoop]$ grep PYLINT_OPTIONS dev-support/personality/hadoop.sh
#PYLINT_OPTIONS="--indent-string=' '"
[sekikn@mobile hadoop]$ dev-support/test-patch.sh
--basedir=/Users/sekikn/dev/hadoop --project=hadoop /tmp/test.patch
(snip)
| Vote | Subsystem | Runtime | Comment
============================================================================
| +1 | @author | 0m 00s | The patch does not contain any @author
| | | | tags.
| +1 | asflicense | 0m 22s | Patch does not generate ASF License
| | | | warnings.
| -1 | pylint | 0m 02s | The applied patch generated 1 new pylint
| | | | issues (total was 318, now 319).
| +1 | whitespace | 0m 00s | Patch has no whitespace issues.
| | | 0m 25s |
|| Subsystem || Report/Notes ||
============================================================================
| git revision | HADOOP-12111 / edaf238 |
| Optional Tests | asflicense pylint |
| uname | Darwin mobile.local 14.4.0 Darwin Kernel Version 14.4.0: Thu May 28
11:35:04 PDT 2015; root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64 |
| Build tool | maven |
| Personality | /Users/sekikn/hadoop/dev-support/personality/hadoop.sh |
| Default Java | 1.7.0_80 |
| pylint | v1.4.4 |
| pylint | /private/tmp/test-patch-hadoop/25180/diff-patch-pylint.txt |
| Max memory used | 47MB |
(snip)
[sekikn@mobile hadoop]$ cat
/private/tmp/test-patch-hadoop/25180/diff-patch-pylint.txt
dev-support/shelldocs.py:271: [W0311(bad-indentation), ] Bad indentation. Found
2 spaces, expected 4
{code}
Also, meaningless awk '-F:' options are removed in this patch.
> test-patch pylint plugin should support indent-string option
> ------------------------------------------------------------
>
> Key: HADOOP-12286
> URL: https://issues.apache.org/jira/browse/HADOOP-12286
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: yetus
> Reporter: Kengo Seki
> Attachments: HADOOP-12286.HADOOP-12111.00.patch
>
>
> By default, pylint uses 4 spaces indentation. But each project has the
> different indentation policy.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)