Commit 067fd473 authored by Luke Mewburn's avatar Luke Mewburn
Browse files

rename asn_config.json to test_config.json

parent a29e50ac
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -250,8 +250,8 @@ def main():
        global change_path_to_unix
        change_path_to_unix = True

    logging.info("Loading asn_config.json")
    asnConfig = json.loads(Path("testing/asn_config.json").read_text())
    logging.info("Loading test_config.json")
    testConfig = json.loads(Path("testing/test_config.json").read_text())

    logging.info("Searching for ASN.1 files")
    fileList = sorted(list(Path(".").rglob("*.asn1")) + list(Path(".").rglob("*.asn")))
@@ -259,7 +259,7 @@ def main():
    for file in fileList:
        logging.debug(f"  {file}")

    parseFileList = filterIgnoredFiles(fileList, asnConfig["parse_ignore"])
    parseFileList = filterIgnoredFiles(fileList, testConfig["parse_ignore"])
    logging.info(f"{len(parseFileList)} files to parse")
    for file in parseFileList:
        logging.debug(f"  {file}")
@@ -274,7 +274,7 @@ def main():
        return 1

    logging.info("Compiling ASN.1 files")
    asnFiles = asnConfig["asn_files"]
    asnFiles = testConfig["asn_files"]
    logging.info(f"{len(asnFiles)} compile targets found")

    compileResults = compileAllTargets(asnFiles)
@@ -284,11 +284,11 @@ def main():
    retval = 0  # Checks now don't prevent subsequent checks from running

    logging.info("Linting files")
    lintFileList = filterIgnoredFiles(fileList, asnConfig["lint_ignore"])
    lintFileList = filterIgnoredFiles(fileList, testConfig["lint_ignore"])
    logging.info(f"{len(lintFileList)} files to lint")
    for file in lintFileList:
        logging.debug(f"  {file}")
    lintResults = lint_asn1.lintASN1Files(lintFileList, asnConfig)
    lintResults = lint_asn1.lintASN1Files(lintFileList, testConfig)
    if processResults(lintResults, "Linting") > 0:
        retval = 1

+2 −2
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ def lintASN1File(asnFile, exceptions):
    return {"ok": len(errors) == 0, "message": errors, "suppressed": suppressed}


def lintASN1Files(fileList, asnConfig):
def lintASN1Files(fileList, testConfig):
    if len(fileList) == 0:
        logging.warning("No files specified")
        return {}
@@ -396,7 +396,7 @@ def lintASN1Files(fileList, asnConfig):
    for f in fileList:
        unixf = str(f).replace("\\", "/")
        exceptions = (
            asnConfig.get("asn_files", {}).get(unixf, {}).get("lint_exceptions", {})
            testConfig.get("asn_files", {}).get(unixf, {}).get("lint_exceptions", {})
        )
        errorMap[str(f)] = lintASN1File(str(f), exceptions)