Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
CI to check for coding style (#15404)
Browse files Browse the repository at this point in the history
  • Loading branch information
ariya committed Jan 8, 2020
1 parent 699510f commit be71ec2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 20 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ For your proposed change, you need to have:
* **an issue** (in the issue tracker) which describe your bug or feature
* **a feature branch** in your git fork

Make sure your code change follows the style guide. To format your code, run `./tools/format-code.sh`.

### Refer the Issue

The commit message needs to link to the issue. This cross-reference is [very important](http://ariya.ofilabs.com/2012/01/small-scale-software-craftsmanship.html) for the following reasons.
Expand Down
11 changes: 11 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
jobs:

- job: 'CodeQuality'
pool:
vmImage: 'macOS 10.13'
steps:
- script: brew install clang-format && clang-format --version
displayName: 'Install clang-format'
- script: bash ./tools/format-code.sh
displayName: 'Run code formatter'
- script: git diff --quiet HEAD
displayName: 'Check if the styling guide is followed'

- job: 'amd64_linux_gcc'
pool:
vmImage: 'ubuntu-18.04'
Expand Down
20 changes: 0 additions & 20 deletions tools/check-style.bat

This file was deleted.

4 changes: 4 additions & 0 deletions tools/format-code.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

cwd=$(pwd)
clang-format -i --style=WebKit $cwd/src/*.h $cwd/src/*.cpp

0 comments on commit be71ec2

Please sign in to comment.