Commit f7166f13 authored by canterburym's avatar canterburym
Browse files

Adding linting exception

parent fc0330b9
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@
        "Tag 6 missing in LALSReport",
        "Tag 8 missing in MMEStartOfInterceptionWithEPSAttachedUE",
        "Tag 11 missing in MMEStartOfInterceptionWithEPSAttachedUE",
        "Tag 161 XIRIEvent field 'iPIRIPacketReport' is not present in IRIEvent"
        "Tag 161 XIRIEvent field 'iPIRIPacketReport' is not present in IRIEvent",
        "Tag 161 missing in IRIEvent"
    ]
}
+14 −8
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ filesWithBigInts = [
    'testing/dependencies/asn/IPAccessPDU.asn'
]

asn1c_path = ""
change_path_to_unix = False

def fix_path(path):
@@ -43,10 +44,10 @@ def syntaxCheckASN(fileList):
        try:
            if file.as_posix() in filesWithBigInts:
                newFile = reconstrainInteger(str(file))
                p = run(["asn1c", '-E', fix_path(newFile)], capture_output=True)
                p = run([asn1c_path, '-E', fix_path(newFile)], capture_output=True)
                Path(newFile).unlink()
            else:
                p = run(["asn1c", '-E', fix_path(str(file))], capture_output=True)
                p = run([asn1c_path, '-E', fix_path(str(file))], capture_output=True)
            if (p.returncode != 0):
                errorMessage = p.stderr.decode().splitlines()[0]
                if errorMessage.startswith('   Value "18446744073709551615" at line'):
@@ -146,10 +147,19 @@ def processResults(results, stageName):
    return errorCount


def main():
if __name__ == "__main__":
    loglevel = os.environ.get("LOGLEVEL", "WARNING").upper()
    logging.basicConfig(level=loglevel)

    logging.info ('Searching for ASN1C')
    asn1c_path = which("asn1c")
    if asn1c_path is None:
        raise Exception ("No asn1c executable found. Please install asn1c")
    logging.info (f"asn1c found at {asn1c_path}")
    if asn1c_path.lower().endswith("bat"):
        logging.info (f"asn1c is a batch file, so assume path separators need to be changed")
        change_path_to_unix = True

    logging.info("Searching for ASN.1 files")
    fileList = list(Path(".").rglob("*.asn1")) + list(Path(".").rglob("*.asn"))
    logging.info(f"{len(fileList)} ASN.1 files found")
@@ -211,7 +221,3 @@ def main():
        exit(1)

    exit(0)
 No newline at end of file


if __name__ == "__main__":
    main()
+1 −1

File changed.

Contains only whitespace changes.