From 6448528e9ae56279b27aed3e629acd1285cff37d Mon Sep 17 00:00:00 2001 From: alschmiedt Date: Fri, 5 Nov 2021 12:55:09 -0700 Subject: [PATCH] chore: applies fixes to clang format (#5677) * chore: update the clang-format version * chore: specify the clang format version to use * chore: remove style tag since it will default to file --- .github/workflows/check_clang_format.yml | 8 +++++--- package-lock.json | 14 +++++++------- package.json | 2 +- scripts/gulpfiles/build_tasks.js | 3 ++- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/check_clang_format.yml b/.github/workflows/check_clang_format.yml index 931688473..57a29fe3b 100644 --- a/.github/workflows/check_clang_format.yml +++ b/.github/workflows/check_clang_format.yml @@ -10,12 +10,14 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: DoozyX/clang-format-lint-action@v0.12 + - uses: DoozyX/clang-format-lint-action@v0.13 with: source: 'core' extensions: 'js' - clangFormatVersion: 12 - style: Google + # This should be as close as possible to the version that the npm + # package supports. This can be found by running: + # npx clang-format --version. + clangFormatVersion: 13 # The Report clang format workflow (report_clang_format.yml) will # run (if required) after this one to post a comment to the PR. diff --git a/package-lock.json b/package-lock.json index 373d20a6a..91abf7e50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@wdio/selenium-standalone-service": "^7.10.1", "babel-eslint": "^10.1.0", "chai": "^4.2.0", - "clang-format": "^1.5.0", + "clang-format": "^1.6.0", "concurrently": "^6.0.0", "eslint": "^7.28.0", "google-closure-compiler": "^20211006.0.0", @@ -3585,9 +3585,9 @@ } }, "node_modules/clang-format": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/clang-format/-/clang-format-1.5.0.tgz", - "integrity": "sha512-C1LucFX7E+ABVYcPEbBHM4PYQ2+WInXsqsLpFlQ9cmRfSbk7A7b1I06h/nE4bQ3MsyEkb31jY2gC0Dtc76b4IA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/clang-format/-/clang-format-1.6.0.tgz", + "integrity": "sha512-W3/L7fWkA8DoLkz9UGjrRnNi+J5a5TuS2HDLqk6WsicpOzb66MBu4eY/EcXhicHriVnAXWQVyk5/VeHWY6w4ow==", "dev": true, "dependencies": { "async": "^1.5.2", @@ -18130,9 +18130,9 @@ } }, "clang-format": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/clang-format/-/clang-format-1.5.0.tgz", - "integrity": "sha512-C1LucFX7E+ABVYcPEbBHM4PYQ2+WInXsqsLpFlQ9cmRfSbk7A7b1I06h/nE4bQ3MsyEkb31jY2gC0Dtc76b4IA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/clang-format/-/clang-format-1.6.0.tgz", + "integrity": "sha512-W3/L7fWkA8DoLkz9UGjrRnNi+J5a5TuS2HDLqk6WsicpOzb66MBu4eY/EcXhicHriVnAXWQVyk5/VeHWY6w4ow==", "dev": true, "requires": { "async": "^1.5.2", diff --git a/package.json b/package.json index 650c2d792..57e8f6e45 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "@wdio/selenium-standalone-service": "^7.10.1", "babel-eslint": "^10.1.0", "chai": "^4.2.0", - "clang-format": "^1.5.0", + "clang-format": "^1.6.0", "concurrently": "^6.0.0", "eslint": "^7.28.0", "google-closure-compiler": "^20211006.0.0", diff --git a/scripts/gulpfiles/build_tasks.js b/scripts/gulpfiles/build_tasks.js index 9cb8e7f93..724565103 100644 --- a/scripts/gulpfiles/build_tasks.js +++ b/scripts/gulpfiles/build_tasks.js @@ -18,6 +18,7 @@ var fs = require('fs'); var execSync = require('child_process').execSync; var through2 = require('through2'); +const clangFormat = require('clang-format'); const clangFormatter = require('gulp-clang-format'); var closureCompiler = require('google-closure-compiler').gulp(); var closureDeps = require('google-closure-deps'); @@ -516,7 +517,7 @@ function cleanBuildDir(done) { */ function format() { return gulp.src(['core/**/*.js'], {base: '.'}) - .pipe(clangFormatter.format('file')) + .pipe(clangFormatter.format('file', clangFormat)) .pipe(gulp.dest('.')); };