chore(lint): re-enable clang-format on tools/
This commit is contained in:
parent
83723671af
commit
5936624d11
|
@ -40,8 +40,6 @@ env:
|
|||
matrix:
|
||||
# Order: a slower build first, so that we don't occupy an idle travis worker waiting for others to complete.
|
||||
- CI_MODE=js
|
||||
# disabled because it currently doesn't do anything
|
||||
#- CI_MODE=lint
|
||||
- CI_MODE=e2e
|
||||
- CI_MODE=saucelabs_required
|
||||
- CI_MODE=browserstack_required
|
||||
|
|
12
circle.yml
12
circle.yml
|
@ -5,17 +5,7 @@ machine:
|
|||
dependencies:
|
||||
pre:
|
||||
- npm install -g npm
|
||||
override:
|
||||
- npm install:
|
||||
environment:
|
||||
# Token for tsd to increase github rate limit
|
||||
# See https://github.com/DefinitelyTyped/tsd#tsdrc
|
||||
# This is not hidden using https://circleci.com/docs/fork-pr-builds#details
|
||||
# because those are not visible for pull requests, and those should also be reliable.
|
||||
# This SSO token belongs to github account angular-github-ratelimit-token which has no access
|
||||
# (password is in Valentine)
|
||||
TSD_GITHUB_TOKEN: ef474500309daea53d5991b3079159a29520a40b
|
||||
|
||||
test:
|
||||
override:
|
||||
- npm run build
|
||||
- gulp lint
|
||||
|
|
36
gulpfile.js
36
gulpfile.js
|
@ -3,16 +3,30 @@
|
|||
// THIS CHECK SHOULD BE THE FIRST THING IN THIS FILE
|
||||
// This is to ensure that we catch env issues before we error while requiring other dependencies.
|
||||
require('./tools/check-environment')(
|
||||
{requiredNpmVersion: '>=3.5.3 <4.0.0', requiredNodeVersion: '>=5.4.1 <6.0.0'});
|
||||
{requiredNpmVersion: '>=3.5.3 <4.0.0', requiredNodeVersion: '>=5.4.1 <6.0.0'});
|
||||
|
||||
|
||||
let gulp = require('gulp');
|
||||
const gulp = require('gulp');
|
||||
const path = require('path');
|
||||
|
||||
const srcsToFmt = ['tools/**/*.ts'];
|
||||
|
||||
gulp.task('tools:build', (done) => {
|
||||
tsc('tools/', done)
|
||||
gulp.task('lint', () => {
|
||||
const format = require('gulp-clang-format');
|
||||
const clangFormat = require('clang-format');
|
||||
return gulp.src(srcsToFmt).pipe(
|
||||
format.checkFormat('file', clangFormat, {verbose: true, fail: true}));
|
||||
});
|
||||
|
||||
gulp.task('format', () => {
|
||||
const format = require('gulp-clang-format');
|
||||
const clangFormat = require('clang-format');
|
||||
return gulp.src(srcsToFmt, { base: '.' }).pipe(
|
||||
format.format('file', clangFormat)).pipe(gulp.dest('.'));
|
||||
});
|
||||
|
||||
gulp.task('tools:build', (done) => { tsc('tools/', done); });
|
||||
|
||||
|
||||
gulp.task('serve', () => {
|
||||
let connect = require('gulp-connect');
|
||||
|
@ -23,9 +37,7 @@ gulp.task('serve', () => {
|
|||
port: 8000,
|
||||
livereload: false,
|
||||
open: false,
|
||||
middleware: (connect, opt) => {
|
||||
return [cors()];
|
||||
}
|
||||
middleware: (connect, opt) => [cors()]
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -33,9 +45,9 @@ gulp.task('serve', () => {
|
|||
function tsc(projectPath, done) {
|
||||
let child_process = require('child_process');
|
||||
|
||||
child_process.spawn(
|
||||
`${__dirname}/node_modules/.bin/tsc`,
|
||||
['-p', `${__dirname}/projectPath`],
|
||||
{stdio: 'inherit'}
|
||||
).on('close', (errorCode) => done(errorCode));
|
||||
child_process
|
||||
.spawn(
|
||||
`${__dirname}/node_modules/.bin/tsc`, ['-p', path.join(__dirname, projectPath)],
|
||||
{stdio: 'inherit'})
|
||||
.on('close', (errorCode) => done(errorCode));
|
||||
}
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -ex -o pipefail
|
||||
|
||||
if [[ ${TRAVIS} && ${CI_MODE} != "lint" ]]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
|
||||
echo 'travis_fold:start:lint'
|
||||
|
||||
gulp lint
|
||||
gulp check-format
|
||||
|
||||
echo 'travis_fold:end:lint'
|
|
@ -9,7 +9,6 @@ cd `dirname $0`
|
|||
source ./env.sh
|
||||
cd ../..
|
||||
|
||||
./scripts/ci-lite/lint.sh
|
||||
./scripts/ci-lite/test_js.sh
|
||||
./scripts/ci-lite/test_e2e.sh
|
||||
./scripts/ci-lite/test_saucelabs.sh
|
||||
|
|
|
@ -79,9 +79,13 @@ function printWarning(issues) {
|
|||
console.warn('');
|
||||
console.warn(Array(110).join('!'));
|
||||
console.warn('!!! Your environment is not in a good shape. Following issues were found:');
|
||||
issues.forEach(function(issue) {console.warn('!!! - ' + issue)});
|
||||
issues.forEach(function(issue) {console.warn('!!! - ' + issue);});
|
||||
console.warn(Array(110).join('!'));
|
||||
console.warn('');
|
||||
|
||||
if (process.env.CI) {
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue