I'd like to use a suppression file to eliminate the false positives golem can give. My current thinking is that each mod create an IDS for each warning, list files which should be suppressed in that IDS, and then amend the checking code to ignore the check if the current source_res is listed in the IDS named after the current check, e.g. for HI61 amend fix_enchantment.tpp to the below.
SET ignore = IDS_OF_SYMBOL("h161" ~%SOURCE_RES%~)
PATCH_IF enchantment = 0
AND magic_flag != 0
AND VARIABLE_IS_SET $item_type(~%type%~)
AND NOT (~%SOURCE_FILE%~ STR_EQ ~aegis.itm~)
AND NOT (~%SOURCE_FILE%~ STR_EQ ~aegis2.itm~) // skip aegis for now, see https://github.com/Gibberlings3/BG2-Fixpack/pull/7
AND ~%ignore%~ = ~-1~
BEGIN
PATCH_PRINT ~HI61: %SOURCE_FILE% - magic flag %magic_flag% and enchantment level %enchantment% are inconsistent.~
END
Not sure if it's going to be convenient to have it split over multiple IDS.
Maybe a single 2DA instead? Read all rows, assign values to an array construct, then use VARIABLE_IS_SET to check for exceptions.
Also, HI61 = hi61 (happy-info-61), not h161.
Please do not PM or email me about my mods and projects. Use forums. Also, see our talk channels.
I put a little time into this, working on the basis of using three 2da files (one each for info, warning and error), with each column being a check and each row being a file. The code currently looks like this:
// Function to determine if a given Hx check (h_check) should be ignored for the specified file (source_res)
DEFINE_PATCH_FUNCTION get_suppression
INT_VAR h_check = 0
STR_VAR twodafile = ~~
RET suppression
BEGIN
SET suppression = 0
PATCH_IF FILE_EXISTS_IN_GAME ~%twodafile%~
BEGIN
TEXT_SPRINT sf ~%SOURCE_RES%~
INNER_ACTION BEGIN
COPY_EXISTING ~%twodafile%~ ~override~
COUNT_2DA_ROWS 1 num_rows
COUNT_2DA_COLS num_cols
READ_2DA_ENTRIES_NOW supression 1
FOR (row = 3; row < num_rows; ++row) BEGIN
READ_2DA_ENTRY_FORMER supression row 0 filename
PATCH_IF ~%filename%~ STRING_EQUAL ~%sf%~ BEGIN
READ_2DA_ENTRY_FORMER supression row h_check supressthis
SET suppression = ~%supressthis%~
END
END
END
END
END
Function call prior to making the existing checks (which are then amended with "AND supression = 0").