[
https://issues.apache.org/jira/browse/YETUS-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14988073#comment-14988073
]
Sean Busbey edited comment on YETUS-116 at 11/3/15 8:39 PM:
------------------------------------------------------------
I think the docs could definitely use more examples to make this stuff easier
to get stated on. For cli args, you essentially need a global variable and two
functions.
Here's what I had in mind here:
{code}
yetus busbey$ git diff -- precommit/test-patch.d/checkstyle.sh
diff --git a/precommit/test-patch.d/checkstyle.sh
b/precommit/test-patch.d/checkstyle.sh
index 24b9ffc..5f88c62 100755
--- a/precommit/test-patch.d/checkstyle.sh
+++ b/precommit/test-patch.d/checkstyle.sh
@@ -17,6 +17,8 @@
add_test_type checkstyle
CHECKSTYLE_TIMER=0
+CHECKSTYLE_GOAL_DEFAULT="checkstyle"
+CHECKSTYLE_GOAL="${CHECKSTYLE_GOAL_DEFAULT}"
function checkstyle_filefilter
{
@@ -30,6 +32,25 @@ function checkstyle_filefilter
fi
}
+function checkstyle_usage
+{
+ echo "Checkstyle specific:"
+ echo "--checkstyle-goal=<goal> Checkstyle maven plugin goal to use, e.g.
'check' or 'checkstyle'. defaults to '${CHECKSTYLE_GOAL_DEFAULT}'."
+}
+
+function checkstyle_parse_args
+{
+ local i
+
+ for i in "$@"; do
+ case ${i} in
+ --checkstyle-goal=*)
+ CHECKSTYLE_GOAL=${i#*=}
+ ;;
+ esac
+ done
+}
+
function checkstyle_runner
{
local repostatus=$1
{code}
Since there were extra args needed, you might have to make an if block or case
statement when it's time to call Maven. If the other args weren't needed, then
where you would normally call checkstyle:checkstyle for maven, you'd replace
with "checkstyle:$\{CHECKSTYLE_GOAL}" (with the quotes).
I'm guessing that this doesn't impact the ant build system at all.
That enough to get you back on track?
was (Author: busbey):
I think the docs could definitely use more examples to make this stuff easier
to get stated on. For cli args, you essentially need a global variable and two
functions.
Here's what I had in mind here:
{code}
yetus busbey$ git diff -- precommit/test-patch.d/checkstyle.sh
diff --git a/precommit/test-patch.d/checkstyle.sh
b/precommit/test-patch.d/checkstyle.sh
index 24b9ffc..5f88c62 100755
--- a/precommit/test-patch.d/checkstyle.sh
+++ b/precommit/test-patch.d/checkstyle.sh
@@ -17,6 +17,8 @@
add_test_type checkstyle
CHECKSTYLE_TIMER=0
+CHECKSTYLE_GOAL_DEFAULT="checkstyle"
+CHECKSTYLE_GOAL="${CHECKSTYLE_GOAL_DEFAULT}"
function checkstyle_filefilter
{
@@ -30,6 +32,25 @@ function checkstyle_filefilter
fi
}
+function checkstyle_usage
+{
+ echo "Checkstyle specific:"
+ echo "--checkstyle-goal=<goal> Checkstyle maven plugin goal to use, e.g.
'check' or 'checkstyle'. defaults to '${CHECKSTYLE_GOAL_DEFAULT}'."
+}
+
+function checkstyle_parse_args
+{
+ local i
+
+ for i in "$@"; do
+ case ${i} in
+ --checkstyle-goal=*)
+ CHECKSTYLE_GOAL=${i#*=}
+ ;;
+ esac
+ done
+}
+
function checkstyle_runner
{
local repostatus=$1
{code}
Since there were extra args needed, you might have to make an if block or case
statement when it's time to call Maven. If the other args weren't needed, then
where you would normally call checkstyle:checkstyle for maven, you'd replace
with "checkstyle:${CHECKSTYLE_GOAL}" (with the quotes).
I'm guessing that this doesn't impact the ant build system at all.
That enough to get you back on track?
> Investigate checkstyle:check goal for checkstyle plugin
> -------------------------------------------------------
>
> Key: YETUS-116
> URL: https://issues.apache.org/jira/browse/YETUS-116
> Project: Yetus
> Issue Type: Task
> Components: Test Patch
> Reporter: Tony Kurc
> Assignee: Tony Kurc
> Priority: Minor
> Attachments: YETUS-116.00.patch
>
>
> From a discussion on the dev mailing list
> (https://mail-archives.apache.org/mod_mbox/yetus-dev/201510.mbox/%3CCAN5cbe4Z%3DgKzX5XbmK1FE8aAt5d3fwN0Yi0N7WtP40rY2fqZBg%40mail.gmail.com%3E)
> checkstyle:check goal may provide some benefits for the checkstyle plugin
> over checkstyle:checkstyle.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)