ci: ignore docs while checking for files in packages
Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7065
This commit is contained in:
@@ -46,20 +46,20 @@ def test_executable_files():
|
||||
"m0755` or a variation thereof.")
|
||||
|
||||
|
||||
# Make sure files are either:
|
||||
# - in root directory (README.md)
|
||||
# - hidden (.ci/, device/.shared-patches/)
|
||||
# - or belong to a package (below a directory with APKBUILD)
|
||||
# Make sure files belong to a package (below a directory with APKBUILD)
|
||||
def test_files_belong_to_package():
|
||||
# Walk directories and set package_dir when we find an APKBUILD
|
||||
# This allows matching files in subdirectories to the package directory.
|
||||
package_dir = None
|
||||
for dirpath, dirs, files in os.walk("."):
|
||||
# Skip "hidden" directories
|
||||
# Skip "hidden" directories (.ci/, device/.shared-patches/)
|
||||
dirs[:] = [d for d in dirs if not d.startswith(".")]
|
||||
# Ignore files in root directory
|
||||
# Ignore files in root directory (README.md)
|
||||
if dirpath == '.':
|
||||
continue
|
||||
# Ignore files under docs/
|
||||
if dirpath.startswith('./docs'):
|
||||
continue
|
||||
|
||||
# Switched to another directory?
|
||||
if package_dir and not dirpath.startswith(package_dir + os.sep):
|
||||
|
||||
Reference in New Issue
Block a user