diff --git a/.circleci/config.yml b/.circleci/config.yml index 5d6471103a25..1ff373563cbc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -301,13 +301,7 @@ workflows: - build-gdevelop_js-wasm-only gdevelop_js-wasm-extra-checks: jobs: - - build-gdevelop_js-debug-sanitizers-and-extra-checks: - # Extra checks are resource intensive so don't all run them. - filters: - branches: - only: - - master - - /experimental-build.*/ + - build-gdevelop_js-debug-sanitizers-and-extra-checks builds: jobs: - build-macos: diff --git a/GDevelop.js/scripts/lint-with-clang-tidy.js b/GDevelop.js/scripts/lint-with-clang-tidy.js index 110d40947f37..4b269697818b 100644 --- a/GDevelop.js/scripts/lint-with-clang-tidy.js +++ b/GDevelop.js/scripts/lint-with-clang-tidy.js @@ -4,11 +4,13 @@ const path = require('path'); const { makeSimplePromisePool } = require('./utils/SimplePromisePool'); const gdevelopRootPath = path.resolve(__dirname, '../../'); -const sourcesRootPath = path.join(gdevelopRootPath, 'Core/GDCore'); +const coreSourcesRootPath = path.join(gdevelopRootPath, 'Core/GDCore'); +const extensionSourcesRootPath = path.join(gdevelopRootPath, 'Extensions'); const excludedPaths = [ - 'Tools/Localization.cpp', // emscripten code which can't be linted - 'Serialization/Serializer.cpp', // Diagnostic that can't be ignored in rapidjson. + 'Core/GDCore/Tools/Localization.cpp', // emscripten code which can't be linted + 'Core/GDCore/Serialization/Serializer.cpp', // Diagnostic that can't be ignored in rapidjson. ]; +const supportedExtensions = ['.cpp', '.h', '.hpp']; async function findClangTidy() { const tryClangTidy = (clangTidyCommandName) => @@ -78,18 +80,18 @@ function findFiles(directoryPath) { list.forEach((file) => { const filePath = path.resolve(directoryPath, file); - const relativePath = path.relative(sourcesRootPath, filePath); + const relativePath = path.relative(gdevelopRootPath, filePath); const stat = fs.statSync(filePath); if (stat && stat.isDirectory() && !excludedPaths.includes(relativePath)) { results = results.concat(findFiles(filePath)); } else { if ( - path.extname(filePath) === '.inl' || + (!supportedExtensions.includes(path.extname(filePath))) || path.basename(filePath) === '.gitignore' || excludedPaths.includes(relativePath) ) { - // Ignore .inl files + // Ignore the file. } else { results.push(filePath); } @@ -108,7 +110,9 @@ async function main() { process.exit(1); } - const filesToCheck = findFiles(sourcesRootPath); + const coreFilesToCheck = findFiles(coreSourcesRootPath); + const extensionFilesToCheck = findFiles(extensionSourcesRootPath); + const filesToCheck = [...coreFilesToCheck, ...extensionFilesToCheck]; // Run clang-tidy on each file. const filesWithErrors = [];