travis: Add CI job to check code formatting.
The CI job will fail if there is any code which does not conform to the style encoded by tools/codeformat.py. And it will list any changes required. uncrustify is built from source because Ubuntu bionic has uncrustify-0.66.1 which is from 2017/11/22 and is missing many options needed here.
This commit is contained in:
parent
69661f3343
commit
f6375ac3eb
21
.travis.yml
21
.travis.yml
|
@ -18,9 +18,28 @@ stages:
|
||||||
- name: test
|
- name: test
|
||||||
|
|
||||||
# define the jobs for the stages
|
# define the jobs for the stages
|
||||||
# order of the jobs has longest running first to optimise total time
|
# approx order of the jobs has longest running first to optimise total time
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
|
# check code formatting
|
||||||
|
- stage: test
|
||||||
|
os: linux
|
||||||
|
arch: arm64
|
||||||
|
dist: bionic
|
||||||
|
env: NAME="code formatting"
|
||||||
|
install:
|
||||||
|
- sudo apt-get install python3-pip
|
||||||
|
- sudo pip3 install black
|
||||||
|
- black --version
|
||||||
|
script:
|
||||||
|
- git clone https://github.com/uncrustify/uncrustify.git $HOME/uncrustify
|
||||||
|
- git -C $HOME/uncrustify checkout uncrustify-0.70.1
|
||||||
|
- mkdir -p $HOME/uncrustify/build
|
||||||
|
- (cd $HOME/uncrustify/build && cmake ..)
|
||||||
|
- make -C $HOME/uncrustify/build
|
||||||
|
- PATH=$HOME/uncrustify/build:$PATH tools/codeformat.py
|
||||||
|
- git diff --exit-code
|
||||||
|
|
||||||
# stm32 port
|
# stm32 port
|
||||||
- stage: test
|
- stage: test
|
||||||
env: NAME="stm32 port build"
|
env: NAME="stm32 port build"
|
||||||
|
|
Loading…
Reference in New Issue