Tools: Add flake8 check to PrintVersion.py

This commit is contained in:
TunaLobster 2022-06-24 14:56:41 -05:00 committed by Peter Barker
parent e77ab54de1
commit 2abf2702ce
1 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,9 @@
""" """
Extract version information for the various vehicle types, print it Extract version information for the various vehicle types, print it
AP_FLAKE8_CLEAN
""" """
import os import os
@ -39,8 +42,8 @@ else:
file = open(includefilepath) file = open(includefilepath)
firmware_version_regex = re.compile(".*define +FIRMWARE_VERSION.*") firmware_version_regex = re.compile(r".*define +FIRMWARE_VERSION.*")
firmware_version_extract_regex = re.compile(".*define +FIRMWARE_VERSION[ ]+(?P<major>\d+)[ ]*,[ ]*(?P<minor>\d+)[ ]*,[ ]*(?P<point>\d+)[ ]*,[ ]*(?P<type>[A-Z_]+)[ ]*") firmware_version_extract_regex = re.compile(r".*define +FIRMWARE_VERSION[ ]+(?P<major>\d+)[ ]*,[ ]*(?P<minor>\d+)[ ]*,[ ]*(?P<point>\d+)[ ]*,[ ]*(?P<type>[A-Z_]+)[ ]*") # noqa: E501
for line in file: for line in file:
if not firmware_version_regex.match(line): if not firmware_version_regex.match(line):