Add optionals to validation tools (#8290)

This commit is contained in:
Björn Dahlgren 2021-06-29 20:21:08 +02:00 committed by GitHub
parent 59e3b07c36
commit 2513ef25de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 81 additions and 77 deletions

View File

@ -1,3 +1,4 @@
//IGNORE_STRING_WARNING(str_ace_tracers_magazine);
#define STRINGS(magazine) author = ECSTRING(common,ACETeam); displayName = CSTRING(magazine)
class CfgMagazines {

View File

@ -17,7 +17,7 @@ def getDefinedStrings(filepath):
return modStrings
def getStringUsage(filepath):
selfmodule = (re.search('addons[\W]*([_a-zA-Z0-9]*)', filepath)).group(1)
selfmodule = (re.search('(addons|optionals)[\W]*([_a-zA-Z0-9]*)', filepath)).group(2)
# print("Checking {0} from {1}".format(filepath,selfmodule))
fileStrings = []
@ -51,10 +51,11 @@ def main(argv):
allDefinedStrings = []
allUsedStrings = []
for folder in ['addons', 'optionals']:
# Allow running from root directory as well as from inside the tools directory
rootDir = "../addons"
if (os.path.exists("addons")):
rootDir = "addons"
rootDir = "../" + folder
if (os.path.exists(folder)):
rootDir = folder
for root, dirnames, filenames in os.walk(rootDir):
for filename in fnmatch.filter(filenames, '*.sqf'):

View File

@ -131,10 +131,11 @@ def main():
parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default="")
args = parser.parse_args()
for folder in ['addons', 'optionals']:
# Allow running from root directory as well as from inside the tools directory
rootDir = "../addons"
if (os.path.exists("addons")):
rootDir = "addons"
rootDir = "../" + folder
if (os.path.exists(folder)):
rootDir = folder
for root, dirnames, filenames in os.walk(rootDir + '/' + args.module):
for filename in fnmatch.filter(filenames, '*.cpp'):

View File

@ -165,10 +165,11 @@ def main():
parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default="")
args = parser.parse_args()
for folder in ['addons', 'optionals']:
# Allow running from root directory as well as from inside the tools directory
rootDir = "../addons"
if (os.path.exists("addons")):
rootDir = "addons"
rootDir = "../" + folder
if (os.path.exists(folder)):
rootDir = folder
for root, dirnames, filenames in os.walk(rootDir + '/' + args.module):
for filename in fnmatch.filter(filenames, '*.sqf'):