diff --git a/CHANGELOG.md b/CHANGELOG.md index fa482547e..c782166a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - FBT: - OFW: Add `-Wundef` to compiler options (by @hedger) - OFW: Ensure that all images conform specification (by @skyhawkillusions & @hedger) + - Don't format images in external apps folder, only firmware (by @Willy-JL) ### Updated: - Apps: diff --git a/SConstruct b/SConstruct index 88c206529..f404bd02e 100644 --- a/SConstruct +++ b/SConstruct @@ -326,6 +326,7 @@ firmware_env.Append( IMG_LINT_SOURCES=[ # Image assets "applications", + "!applications/external", "assets", ], ) diff --git a/scripts/imglint.py b/scripts/imglint.py index fc63f3355..e28098653 100644 --- a/scripts/imglint.py +++ b/scripts/imglint.py @@ -57,10 +57,15 @@ class ImageLint(App): def _gather_images(self, folders): images = [] for folder in folders: - for dirpath, _, filenames in os.walk(folder): + exclude = folder.startswith("!") + for dirpath, _, filenames in os.walk(folder.removeprefix("!")): for filename in filenames: if self.is_file_an_icon(filename): - images.append(os.path.join(dirpath, filename)) + filepath = os.path.join(dirpath, filename) + if exclude: + images.remove(filepath) + else: + images.append(filepath) return images def is_file_an_icon(self, filename):