-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add formatting job on CI
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
resources: | ||
containers: | ||
- container: fmt | ||
image: pointcloudlibrary/fmt | ||
|
||
jobs: | ||
- job: formatting | ||
displayName: Check code formatting | ||
pool: | ||
vmImage: 'Ubuntu 16.04' | ||
container: fmt | ||
steps: | ||
- script: ./.dev/format.sh $(which clang-format-8) . | ||
displayName: 'Run clang-format' | ||
- script: git diff > formatting.patch | ||
displayName: 'Compute diff' | ||
- script: cat formatting.patch | ||
displayName: 'Show diff' | ||
- task: CopyFiles@2 | ||
inputs: | ||
sourceFolder: '$(Build.SourcesDirectory)' | ||
contents: 'formatting.patch' | ||
targetFolder: '$(Build.ArtifactStagingDirectory)' | ||
displayName: 'Copy diff to staging directory' | ||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
pathtoPublish: '$(Build.ArtifactStagingDirectory)' | ||
artifactName: formatting | ||
displayName: 'Publish diff' | ||
- script: "[ ! -s formatting.patch ]" | ||
displayName: 'Set job exit status' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters