We only disable LOG015 rule, as in the simple situation of pmaports, it doesn't matter too much if in pytest we are using the root logger or a custom one. Signed-off-by: Pablo Correa Gómez <pabloyoyoista@postmarketos.org> Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/9363>
33 lines
1.0 KiB
Python
Executable File
33 lines
1.0 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
# Copyright 2025 Stefan Hansson
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
import glob
|
|
import os.path
|
|
import subprocess
|
|
import sys
|
|
|
|
import common
|
|
|
|
if __name__ == "__main__":
|
|
if common.commit_message_has_string("[ci:skip-dint]"):
|
|
print("WARNING: not linting deviceinfo files ([ci:skip-dint])")
|
|
sys.exit(0)
|
|
|
|
if "deviceinfo_schema.toml" in common.get_changed_files():
|
|
print("deviceinfo_schema.toml changed -> checking all deviceinfo files")
|
|
pmaports_dir = common.get_pmaports_dir()
|
|
deviceinfo_files = set(glob.glob(pmaports_dir + "/device/*/*/deviceinfo"))
|
|
else:
|
|
# only lint deviceinfo files in the devices repo
|
|
deviceinfo_files = {
|
|
file
|
|
for file in common.get_changed_files()
|
|
if os.path.basename(file) == "deviceinfo" and file.startswith("device/")
|
|
}
|
|
|
|
try:
|
|
subprocess.run(["dint", "check", *deviceinfo_files], text=True, check=True)
|
|
except subprocess.CalledProcessError as exception:
|
|
sys.exit(exception.returncode)
|