From 7c4229b705c820fa472ef7782339edeea8bad029 Mon Sep 17 00:00:00 2001 From: Shohei Yamasaki Date: Tue, 21 Jun 2016 13:51:42 +0900 Subject: [PATCH 01/14] fix --- index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/index.php b/index.php index c90eec4..80aa84b 100644 --- a/index.php +++ b/index.php @@ -1,2 +1,3 @@ Date: Tue, 21 Jun 2016 13:56:55 +0900 Subject: [PATCH 02/14] gem install --- check_syntax.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check_syntax.sh b/check_syntax.sh index 667f179..776c455 100755 --- a/check_syntax.sh +++ b/check_syntax.sh @@ -1,12 +1,13 @@ #!/bin/bash echo "Start" - LIST=`git diff --name-only origin/master | grep '.php'` if [ -z $LIST ]; then echo "Success" exit 0 fi +gem install checkstyle_filter-git + vendor/bin/phpcs index.php --standard=PSR2 --report=checkstyle \ | checkstyle_filter-git diff origin/master From 11e5517d7a095312a3b063f9594744e77ab715a3 Mon Sep 17 00:00:00 2001 From: Shohei Yamasaki Date: Tue, 21 Jun 2016 14:10:06 +0900 Subject: [PATCH 03/14] saddler --- check_syntax.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/check_syntax.sh b/check_syntax.sh index 776c455..3425cb4 100755 --- a/check_syntax.sh +++ b/check_syntax.sh @@ -7,7 +7,11 @@ if [ -z $LIST ]; then exit 0 fi -gem install checkstyle_filter-git - vendor/bin/phpcs index.php --standard=PSR2 --report=checkstyle \ | checkstyle_filter-git diff origin/master + +vendor/bin/phpcs index.php --standard=PSR2 --report=checkstyle \ + | bundle exec checkstyle_filter-git diff origin/master \ + | bundle exec saddler report \ + --require saddler/reporter/github \ + --reporter Saddler::Reporter::Github::PullRequestComment From d2dca047f769627df9a054f925ae3dd8b54d0ee7 Mon Sep 17 00:00:00 2001 From: Shohei Yamasaki Date: Tue, 21 Jun 2016 14:20:32 +0900 Subject: [PATCH 04/14] fix --- check_syntax.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_syntax.sh b/check_syntax.sh index 3425cb4..cb2c09a 100755 --- a/check_syntax.sh +++ b/check_syntax.sh @@ -8,10 +8,10 @@ if [ -z $LIST ]; then fi vendor/bin/phpcs index.php --standard=PSR2 --report=checkstyle \ - | checkstyle_filter-git diff origin/master + | bundle exec checkstyle_filter-git diff origin/master vendor/bin/phpcs index.php --standard=PSR2 --report=checkstyle \ | bundle exec checkstyle_filter-git diff origin/master \ | bundle exec saddler report \ --require saddler/reporter/github \ - --reporter Saddler::Reporter::Github::PullRequestComment + --reporter Saddler::Reporter::Github::PullRequestReviewComment From ec54e7f5bf55b63d00776dba7b5cacff344d85bb Mon Sep 17 00:00:00 2001 From: Shohei Yamasaki Date: Tue, 21 Jun 2016 14:57:50 +0900 Subject: [PATCH 05/14] Fix --- check_syntax.sh | 3 --- index.php | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/check_syntax.sh b/check_syntax.sh index cb2c09a..75ab5f0 100755 --- a/check_syntax.sh +++ b/check_syntax.sh @@ -7,9 +7,6 @@ if [ -z $LIST ]; then exit 0 fi -vendor/bin/phpcs index.php --standard=PSR2 --report=checkstyle \ - | bundle exec checkstyle_filter-git diff origin/master - vendor/bin/phpcs index.php --standard=PSR2 --report=checkstyle \ | bundle exec checkstyle_filter-git diff origin/master \ | bundle exec saddler report \ diff --git a/index.php b/index.php index 80aa84b..8034fb5 100644 --- a/index.php +++ b/index.php @@ -1,3 +1,7 @@ Date: Tue, 21 Jun 2016 15:01:58 +0900 Subject: [PATCH 06/14] fix --- check_syntax.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/check_syntax.sh b/check_syntax.sh index 75ab5f0..0a62bb1 100755 --- a/check_syntax.sh +++ b/check_syntax.sh @@ -7,6 +7,9 @@ if [ -z $LIST ]; then exit 0 fi +echo $CI_PULL_REQUESTS +echo $CI_PULL_REQUEST + vendor/bin/phpcs index.php --standard=PSR2 --report=checkstyle \ | bundle exec checkstyle_filter-git diff origin/master \ | bundle exec saddler report \ From 03c5e58ac0311125ac17d1e3bd0d5c112b76a7fa Mon Sep 17 00:00:00 2001 From: Shohei Yamasaki Date: Tue, 21 Jun 2016 15:17:59 +0900 Subject: [PATCH 07/14] fix --- check_syntax.sh | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/check_syntax.sh b/check_syntax.sh index 0a62bb1..5759b73 100755 --- a/check_syntax.sh +++ b/check_syntax.sh @@ -2,16 +2,19 @@ echo "Start" LIST=`git diff --name-only origin/master | grep '.php'` -if [ -z $LIST ]; then - echo "Success" + +if [ -z "$LIST" ]; then + echo "PHP file not changed." exit 0 fi echo $CI_PULL_REQUESTS echo $CI_PULL_REQUEST -vendor/bin/phpcs index.php --standard=PSR2 --report=checkstyle \ - | bundle exec checkstyle_filter-git diff origin/master \ - | bundle exec saddler report \ - --require saddler/reporter/github \ - --reporter Saddler::Reporter::Github::PullRequestReviewComment +if [ -n "$CI_PULL_REQUESTS" ]; then + vendor/bin/phpcs index.php --standard=PSR2 --report=checkstyle \ + | bundle exec checkstyle_filter-git diff origin/master \ + | bundle exec saddler report \ + --require saddler/reporter/github \ + --reporter Saddler::Reporter::Github::PullRequestReviewComment +fi From 17e179fec4ebbaea0c9ba224046fd1694bb2465b Mon Sep 17 00:00:00 2001 From: Shohei Yamasaki Date: Tue, 21 Jun 2016 15:19:55 +0900 Subject: [PATCH 08/14] fix --- index.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.php b/index.php index 8034fb5..f22d889 100644 --- a/index.php +++ b/index.php @@ -5,3 +5,8 @@ function hoge() { return true; } + +function moge() +{ + return true; +} From 0368ecf2c7eab7ce84623f56870f5b436a1633e4 Mon Sep 17 00:00:00 2001 From: Shohei Yamasaki Date: Tue, 21 Jun 2016 15:22:26 +0900 Subject: [PATCH 09/14] fix --- check_syntax.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/check_syntax.sh b/check_syntax.sh index 5759b73..8e525fe 100755 --- a/check_syntax.sh +++ b/check_syntax.sh @@ -8,13 +8,14 @@ if [ -z "$LIST" ]; then exit 0 fi -echo $CI_PULL_REQUESTS -echo $CI_PULL_REQUEST if [ -n "$CI_PULL_REQUESTS" ]; then + echo $CI_PULL_REQUESTS +fi + vendor/bin/phpcs index.php --standard=PSR2 --report=checkstyle \ | bundle exec checkstyle_filter-git diff origin/master \ | bundle exec saddler report \ --require saddler/reporter/github \ --reporter Saddler::Reporter::Github::PullRequestReviewComment -fi + From 31065f39bfb2bca43778b74f0ca4fd239d0139a0 Mon Sep 17 00:00:00 2001 From: Shohei Yamasaki Date: Tue, 21 Jun 2016 15:27:03 +0900 Subject: [PATCH 10/14] fix --- check_syntax.sh | 5 +---- test.php | 12 ++++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 test.php diff --git a/check_syntax.sh b/check_syntax.sh index 8e525fe..368e826 100755 --- a/check_syntax.sh +++ b/check_syntax.sh @@ -10,12 +10,9 @@ fi if [ -n "$CI_PULL_REQUESTS" ]; then - echo $CI_PULL_REQUESTS -fi - vendor/bin/phpcs index.php --standard=PSR2 --report=checkstyle \ | bundle exec checkstyle_filter-git diff origin/master \ | bundle exec saddler report \ --require saddler/reporter/github \ --reporter Saddler::Reporter::Github::PullRequestReviewComment - +fi diff --git a/test.php b/test.php new file mode 100644 index 0000000..f22d889 --- /dev/null +++ b/test.php @@ -0,0 +1,12 @@ + Date: Tue, 21 Jun 2016 15:33:20 +0900 Subject: [PATCH 11/14] fix --- check_syntax.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/check_syntax.sh b/check_syntax.sh index 368e826..94ee9d2 100755 --- a/check_syntax.sh +++ b/check_syntax.sh @@ -10,7 +10,9 @@ fi if [ -n "$CI_PULL_REQUESTS" ]; then - vendor/bin/phpcs index.php --standard=PSR2 --report=checkstyle \ + git diff --name-only origin/master \ + | grep '.php' \ + | xargs vendor/bin/phpcs --standard=PSR2 --report=checkstyle \ | bundle exec checkstyle_filter-git diff origin/master \ | bundle exec saddler report \ --require saddler/reporter/github \ From b26be544cf5c0ee9b6002e3b9a4408eabe14f0c6 Mon Sep 17 00:00:00 2001 From: Shohei Yamasaki Date: Tue, 21 Jun 2016 15:36:55 +0900 Subject: [PATCH 12/14] fix --- index.php | 7 +++++-- test.php | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index f22d889..5648561 100644 --- a/index.php +++ b/index.php @@ -1,8 +1,11 @@ Date: Tue, 21 Jun 2016 15:38:54 +0900 Subject: [PATCH 13/14] fix --- check_syntax.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_syntax.sh b/check_syntax.sh index 94ee9d2..11ac79f 100755 --- a/check_syntax.sh +++ b/check_syntax.sh @@ -12,7 +12,7 @@ fi if [ -n "$CI_PULL_REQUESTS" ]; then git diff --name-only origin/master \ | grep '.php' \ - | xargs vendor/bin/phpcs --standard=PSR2 --report=checkstyle \ + | xargs vendor/bin/phpcs -n --standard=PSR2 --report=checkstyle \ | bundle exec checkstyle_filter-git diff origin/master \ | bundle exec saddler report \ --require saddler/reporter/github \ From da4bca3ea9caf1615cd6fc6d6b243e78b0e46dce Mon Sep 17 00:00:00 2001 From: Shohei Yamasaki Date: Tue, 21 Jun 2016 17:05:52 +0900 Subject: [PATCH 14/14] fix --- check_syntax.sh | 4 ++-- index.php | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/check_syntax.sh b/check_syntax.sh index 11ac79f..4b94004 100755 --- a/check_syntax.sh +++ b/check_syntax.sh @@ -1,7 +1,7 @@ #!/bin/bash echo "Start" -LIST=`git diff --name-only origin/master | grep '.php'` +LIST=`git diff --name-only origin/master | grep -e '.php$'` if [ -z "$LIST" ]; then echo "PHP file not changed." @@ -11,7 +11,7 @@ fi if [ -n "$CI_PULL_REQUESTS" ]; then git diff --name-only origin/master \ - | grep '.php' \ + | grep -e '.php$' \ | xargs vendor/bin/phpcs -n --standard=PSR2 --report=checkstyle \ | bundle exec checkstyle_filter-git diff origin/master \ | bundle exec saddler report \ diff --git a/index.php b/index.php index 5648561..8ad9db8 100644 --- a/index.php +++ b/index.php @@ -4,8 +4,7 @@ echo "True"; } -function hoge() -{ +function hoge() { return true; } @@ -13,3 +12,9 @@ function moge() { return true; } + +if (true) { + echo "True"; +} + +