Jerome Forissier | 8353e24 | 2014-11-26 16:57:07 +0100 | [diff] [blame] | 1 | language: c |
| 2 | |
Pascal Brand | 260fa3f | 2014-10-08 08:18:53 +0200 | [diff] [blame] | 3 | notifications: |
| 4 | - email: true |
| 5 | |
Jens Wiklander | 517d41f | 2016-02-29 15:02:13 +0100 | [diff] [blame] | 6 | git: |
| 7 | depth: 1000000 |
| 8 | |
Pascal Brand | 260fa3f | 2014-10-08 08:18:53 +0200 | [diff] [blame] | 9 | before_script: |
Jerome Forissier | a138789 | 2019-02-22 17:01:06 +0100 | [diff] [blame] | 10 | - export OPTEE_OS=$PWD |
Pascal Brand | 1b10abf | 2014-10-20 13:24:54 +0200 | [diff] [blame] | 11 | |
Pascal Brand | 7d65727 | 2014-11-03 12:49:01 +0100 | [diff] [blame] | 12 | # Download checkpatch.pl |
Jerome Forissier | a138789 | 2019-02-22 17:01:06 +0100 | [diff] [blame] | 13 | - export KERNEL=$HOME/linux && mkdir -p $KERNEL/scripts && cd $KERNEL/scripts |
Pascal Brand | 7d65727 | 2014-11-03 12:49:01 +0100 | [diff] [blame] | 14 | - wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/checkpatch.pl && chmod a+x checkpatch.pl |
Pascal Brand | 1b10abf | 2014-10-20 13:24:54 +0200 | [diff] [blame] | 15 | - wget https://raw.githubusercontent.com/torvalds/linux/master/scripts/spelling.txt |
Jens Wiklander | 51ff850 | 2016-10-19 17:50:45 +0200 | [diff] [blame] | 16 | - echo "invalid.struct.name" >const_structs.checkpatch |
Jerome Forissier | a138789 | 2019-02-22 17:01:06 +0100 | [diff] [blame] | 17 | - export PATH=$KERNEL/scripts/:$PATH |
| 18 | - cd $OPTEE_OS |
| 19 | - source scripts/checkpatch_inc.sh |
Pascal Brand | 1b10abf | 2014-10-20 13:24:54 +0200 | [diff] [blame] | 20 | |
Jerome Forissier | a138789 | 2019-02-22 17:01:06 +0100 | [diff] [blame] | 21 | # Install pycodestyle |
Jerome Forissier | a3a309a | 2018-11-14 13:36:08 +0100 | [diff] [blame] | 22 | - pip install --upgrade --user pycodestyle |
Jerome Forissier | 644dfaa | 2017-11-27 16:40:16 +0100 | [diff] [blame] | 23 | |
Pascal Brand | 260fa3f | 2014-10-08 08:18:53 +0200 | [diff] [blame] | 24 | script: |
Jerome Forissier | e04653b | 2016-08-26 10:40:06 +0200 | [diff] [blame] | 25 | # Run checkpatch.pl on: |
| 26 | # - the tip of the branch if we're not in a pull request |
| 27 | # - each commit in the development branch that's not in the target branch otherwise |
| 28 | - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then checkpatch HEAD; else for c in $(git rev-list HEAD^1..HEAD^2); do checkpatch $c || failed=1; done; [ -z "$failed" ]; fi |
Jerome Forissier | 3891de7 | 2016-09-14 17:55:39 +0200 | [diff] [blame] | 29 | # If we have a pull request with more than 1 commit, also check the squashed commits |
| 30 | # Useful to check if fix-up commits do indeed solve previous checkpatch errors |
| 31 | - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then if [ "$(git rev-list --count HEAD^1..HEAD^2)" -gt 1 ]; then checkdiff $(git rev-parse HEAD^1) $(git rev-parse HEAD^2); fi; fi |
Pascal Brand | 1b10abf | 2014-10-20 13:24:54 +0200 | [diff] [blame] | 32 | |
Jerome Forissier | a3a309a | 2018-11-14 13:36:08 +0100 | [diff] [blame] | 33 | # Check Python style |
Jerome Forissier | a138789 | 2019-02-22 17:01:06 +0100 | [diff] [blame] | 34 | - pycodestyle scripts/*.py core/arch/arm/plat-stm32mp1/scripts/stm32image.py |