ci: make removed=False the default for get_changed_files
Eventually we probably want this everywhere. Signed-off-by: Pablo Correa Gómez <pabloyoyoista@postmarketos.org> Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7868>
This commit is contained in:
@@ -42,7 +42,7 @@ if __name__ == "__main__":
|
||||
custom_valid_options += kconfigcheck_categories
|
||||
os.environ["CUSTOM_VALID_OPTIONS"] = " ".join(custom_valid_options)
|
||||
|
||||
apkbuilds = {file for file in common.get_changed_files(removed=False)
|
||||
apkbuilds = {file for file in common.get_changed_files()
|
||||
if os.path.basename(file) == "APKBUILD"}
|
||||
if len(apkbuilds) < 1:
|
||||
print("No APKBUILDs to lint")
|
||||
|
||||
+2
-2
@@ -108,7 +108,7 @@ def get_base_commit() -> str:
|
||||
return commit
|
||||
|
||||
|
||||
def get_changed_files(removed=True):
|
||||
def get_changed_files(removed=False):
|
||||
""" Get all changed files and print them, as well as the branch and the
|
||||
commit that was used for the diff.
|
||||
:param removed: also return removed files (default: True)
|
||||
@@ -133,7 +133,7 @@ def get_changed_files(removed=True):
|
||||
|
||||
def get_changed_packages(skip_archived: bool = False):
|
||||
ret = set()
|
||||
for file in get_changed_files():
|
||||
for file in get_changed_files(removed=True):
|
||||
dirname, filename = os.path.split(file)
|
||||
|
||||
# Skip files:
|
||||
|
||||
@@ -12,7 +12,7 @@ if __name__ == "__main__":
|
||||
print("WARNING: not linting deviceinfo files ([ci:skip-dint])")
|
||||
exit(0)
|
||||
# only lint deviceinfo files in the devices repo
|
||||
deviceinfo_files = {file for file in common.get_changed_files(removed=False)
|
||||
deviceinfo_files = {file for file in common.get_changed_files()
|
||||
if os.path.basename(file) == "deviceinfo" and file.startswith("device/")}
|
||||
|
||||
try:
|
||||
|
||||
@@ -173,7 +173,7 @@ if __name__ == "__main__":
|
||||
devices_under_test = set()
|
||||
packages_modified = set()
|
||||
# Get and print modified packages
|
||||
for file in common.get_changed_files(removed=False):
|
||||
for file in common.get_changed_files():
|
||||
path = Path(file)
|
||||
|
||||
# Check if the modified's file parent folder is one of a supported dev
|
||||
|
||||
+1
-1
@@ -72,7 +72,7 @@ def show_error_all():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if "kconfigcheck.toml" in common.get_changed_files(removed=False):
|
||||
if "kconfigcheck.toml" in common.get_changed_files():
|
||||
print("kconfigcheck.toml changed -> checking all kernels")
|
||||
if not check_kconfig_all():
|
||||
show_error_all()
|
||||
|
||||
@@ -14,7 +14,7 @@ def test_aports_ui():
|
||||
"""
|
||||
pmaports_cfg = pmb.config.pmaports.read_config()
|
||||
for arch in pmaports_cfg["supported_arches"].split(","):
|
||||
for path in common.get_changed_files(removed=False):
|
||||
for path in common.get_changed_files():
|
||||
path = Path(path)
|
||||
|
||||
if path.name != "APKBUILD":
|
||||
|
||||
Reference in New Issue
Block a user