Skip to content

Commit

Permalink
Merge branch 'master' into atomized-clf
Browse files Browse the repository at this point in the history
  • Loading branch information
KoishiVibe authored Dec 3, 2024
2 parents 561d8bb + cece3e4 commit 3ac2da6
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions tools/build/lib/byond.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,18 @@ export const DreamMaker = async (dmeFile, options = {}) => {
testOutputFile(`${dmeBaseName}.rsc`);
const runWithWarningChecks = async (dmPath, args) => {
const execReturn = await Juke.exec(dmPath, args);
const ignoredWarningCodes = options.ignoreWarningCodes ?? [];
const reg =
ignoredWarningCodes.length > 0
? new RegExp(`\d+:warning: (?!(${ignoredWarningCodes.join("|")}))`)
: /\d+:warning: /;
if (options.warningsAsErrors && execReturn.combined.match(reg)) {
Juke.logger.error(`Compile warnings treated as errors`);
throw new Juke.ExitCode(2);
if(options.warningsAsErrors){
const ignoredWarningCodes = options.ignoreWarningCodes ?? [];
if(ignoredWarningCodes.length > 0 ){
Juke.logger.info('Ignored warning codes:', ignoredWarningCodes.join(', '));
}
const base_regex = '\\d+:warning( \\([a-z_]*\\))?:'
const with_ignores = `\\d+:warning( \\([a-z_]*\\))?:(?!(${ignoredWarningCodes.map(x => `.*${x}.*$`).join('|')}))`
const reg = ignoredWarningCodes.length > 0 ? new RegExp(with_ignores, "m") : new RegExp(base_regex,"m")
if (options.warningsAsErrors && execReturn.combined.match(reg)) {
Juke.logger.error(`Compile warnings treated as errors`);
throw new Juke.ExitCode(2);
}
}
return execReturn;
};
Expand Down

0 comments on commit 3ac2da6

Please sign in to comment.