mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Compare commits
3 Commits
40c576bc2d
...
fix/clang-
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9bfde5425f | ||
![]() |
542d799cc7 | ||
![]() |
8782b5d5b4 |
@@ -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:
|
||||
|
@@ -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 = [];
|
||||
|
Reference in New Issue
Block a user