mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2025-10-09 22:52:32 +02:00
FBT: Only format images in firmware, not ext apps
It was formatting demo screenshots too There might a better way to detect only icons, but not formatting also means less merge conflicts
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
- FBT:
|
- FBT:
|
||||||
- OFW: Add `-Wundef` to compiler options (by @hedger)
|
- OFW: Add `-Wundef` to compiler options (by @hedger)
|
||||||
- OFW: Ensure that all images conform specification (by @skyhawkillusions & @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:
|
### Updated:
|
||||||
- Apps:
|
- Apps:
|
||||||
|
@@ -326,6 +326,7 @@ firmware_env.Append(
|
|||||||
IMG_LINT_SOURCES=[
|
IMG_LINT_SOURCES=[
|
||||||
# Image assets
|
# Image assets
|
||||||
"applications",
|
"applications",
|
||||||
|
"!applications/external",
|
||||||
"assets",
|
"assets",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@@ -57,10 +57,15 @@ class ImageLint(App):
|
|||||||
def _gather_images(self, folders):
|
def _gather_images(self, folders):
|
||||||
images = []
|
images = []
|
||||||
for folder in folders:
|
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:
|
for filename in filenames:
|
||||||
if self.is_file_an_icon(filename):
|
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
|
return images
|
||||||
|
|
||||||
def is_file_an_icon(self, filename):
|
def is_file_an_icon(self, filename):
|
||||||
|
Reference in New Issue
Block a user