diff mbox

[PATCHv2] travis: add code style checks

Message ID 20170208215053.32544-1-maxim.uvarov@linaro.org
State Accepted
Commit 332d48c9c25504b3cbb9451e292a98c15df17ccb
Headers show

Commit Message

Maxim Uvarov Feb. 8, 2017, 9:50 p.m. UTC
run checkpatch.pl to check code style for applied patches.
Do not check spelling now. Will check it only on merge requests.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

---
 v2: travis generates buggy $TRAVIS_COMMIT_RANGE env variable on git push.
     That is situation when commit exist on remote git but is not accessible
     with git clone. That is known issues and force push very rare case. Check
     only the latest commit in case of force push. On merge request and fast forward
     pushes validate all patches.

 .travis.yml | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

-- 
2.11.0.295.gd7dffce

Comments

Mike Holmes Feb. 9, 2017, 1:36 p.m. UTC | #1
On 8 February 2017 at 16:50, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> run checkpatch.pl to check code style for applied patches.

> Do not check spelling now. Will check it only on merge requests.

>

> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

>


Reviewed-by: Mike Holmes <mike.holmes@linaro.org>



> ---

>  v2: travis generates buggy $TRAVIS_COMMIT_RANGE env variable on git push.

>      That is situation when commit exist on remote git but is not

> accessible

>      with git clone. That is known issues and force push very rare case.

> Check

>      only the latest commit in case of force push. On merge request and

> fast forward

>      pushes validate all patches.

>

>  .travis.yml | 15 +++++++++++++++

>  1 file changed, 15 insertions(+)

>

> diff --git a/.travis.yml b/.travis.yml

> index 5b9a29a6..9544ec8f 100644

> --- a/.travis.yml

> +++ b/.travis.yml

> @@ -95,6 +95,21 @@ before_install:

>          - popd

>

>  script:

> +        - echo $TRAVIS_COMMIT_RANGE

> +        - ODP_PACHES=`echo $TRAVIS_COMMIT_RANGE | sed 's/\.//'`

> +#        Generate patches provided with $TRAVIS_COMMIT_RANGE.

> +#        In case of force push and range is broken validate only the

> latest commit if it's not merge commit.

> +        - git format-patch $ODP_PACHES;

> +          if [ $? -ne 0 ]; then

> +            git show --summary HEAD| grep -q '^Merge:';

> +            if [ $? -ne 0 ]; then

> +              git format-patch HEAD^;

> +              perl ./scripts/checkpatch.pl *.patch;

> +            fi;

> +          else

> +            perl ./scripts/checkpatch.pl *.patch;

> +          fi

> +

>          - ./bootstrap

>          - ./configure

>          - make doxygen-doc

> --

> 2.11.0.295.gd7dffce

>

>



-- 
Mike Holmes
Program Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
Maxim Uvarov Feb. 9, 2017, 4:06 p.m. UTC | #2
Merged,
Maxim.

On 02/09/17 16:36, Mike Holmes wrote:
> 

> 

> On 8 February 2017 at 16:50, Maxim Uvarov <maxim.uvarov@linaro.org

> <mailto:maxim.uvarov@linaro.org>> wrote:

> 

>     run checkpatch.pl <http://checkpatch.pl> to check code style for

>     applied patches.

>     Do not check spelling now. Will check it only on merge requests.

> 

>     Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org

>     <mailto:maxim.uvarov@linaro.org>>

> 

> 

> Reviewed-by: Mike Holmes <mike.holmes@linaro.org

> <mailto:mike.holmes@linaro.org>>

>  

> 

>     ---

>      v2: travis generates buggy $TRAVIS_COMMIT_RANGE env variable on git

>     push.

>          That is situation when commit exist on remote git but is not

>     accessible

>          with git clone. That is known issues and force push very rare

>     case. Check

>          only the latest commit in case of force push. On merge request

>     and fast forward

>          pushes validate all patches.

> 

>      .travis.yml | 15 +++++++++++++++

>      1 file changed, 15 insertions(+)

> 

>     diff --git a/.travis.yml b/.travis.yml

>     index 5b9a29a6..9544ec8f 100644

>     --- a/.travis.yml

>     +++ b/.travis.yml

>     @@ -95,6 +95,21 @@ before_install:

>              - popd

> 

>      script:

>     +        - echo $TRAVIS_COMMIT_RANGE

>     +        - ODP_PACHES=`echo $TRAVIS_COMMIT_RANGE | sed 's/\.//'`

>     +#        Generate patches provided with $TRAVIS_COMMIT_RANGE.

>     +#        In case of force push and range is broken validate only

>     the latest commit if it's not merge commit.

>     +        - git format-patch $ODP_PACHES;

>     +          if [ $? -ne 0 ]; then

>     +            git show --summary HEAD| grep -q '^Merge:';

>     +            if [ $? -ne 0 ]; then

>     +              git format-patch HEAD^;

>     +              perl ./scripts/checkpatch.pl <http://checkpatch.pl>

>     *.patch;

>     +            fi;

>     +          else

>     +            perl ./scripts/checkpatch.pl <http://checkpatch.pl>

>     *.patch;

>     +          fi

>     +

>              - ./bootstrap

>              - ./configure

>              - make doxygen-doc

>     --

>     2.11.0.295.gd7dffce

> 

> 

> 

> 

> -- 

> Mike Holmes

> Program Manager - Linaro Networking Group

> Linaro.org <http://www.linaro.org/>* **│ *Open source software for ARM SoCs

> "Work should be fun and collaborative, the rest follows"

> 

> __

> 

>
diff mbox

Patch

diff --git a/.travis.yml b/.travis.yml
index 5b9a29a6..9544ec8f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -95,6 +95,21 @@  before_install:
         - popd
 
 script:
+        - echo $TRAVIS_COMMIT_RANGE
+        - ODP_PACHES=`echo $TRAVIS_COMMIT_RANGE | sed 's/\.//'`
+#        Generate patches provided with $TRAVIS_COMMIT_RANGE.
+#        In case of force push and range is broken validate only the latest commit if it's not merge commit.
+        - git format-patch $ODP_PACHES;
+          if [ $? -ne 0 ]; then
+            git show --summary HEAD| grep -q '^Merge:';
+            if [ $? -ne 0 ]; then
+              git format-patch HEAD^;
+              perl ./scripts/checkpatch.pl *.patch;
+            fi;
+          else
+            perl ./scripts/checkpatch.pl *.patch;
+          fi
+
         - ./bootstrap
         - ./configure
         - make doxygen-doc