From 4edd527e16462267c439554f6bacb51edbe25377 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Tue, 10 Dec 2024 05:54:31 +0000 Subject: [PATCH 1/3] FBT: Don't lint JS packages --- firmware.scons | 2 ++ scripts/lint.py | 26 ++++++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/firmware.scons b/firmware.scons index aa91c7e3be..77bf84de0d 100644 --- a/firmware.scons +++ b/firmware.scons @@ -29,6 +29,8 @@ env = ENV.Clone( TARGETS_ROOT=Dir("#/targets"), LINT_SOURCES=[ Dir("applications"), + # Not C code + Dir("!applications/system/js_app/packages"), ], LIBPATH=[ "${LIB_DIST_DIR}", diff --git a/scripts/lint.py b/scripts/lint.py index 8530209bec..896cd38128 100755 --- a/scripts/lint.py +++ b/scripts/lint.py @@ -35,21 +35,25 @@ def init(self): self.parser_format.set_defaults(func=self.format) @staticmethod - def _filter_lint_directories(dirnames: list[str]): + def _filter_lint_directories( + dirpath: str, dirnames: list[str], excludes: tuple[str] + ): # Skipping 3rd-party code - usually resides in subfolder "lib" if "lib" in dirnames: dirnames.remove("lib") - # Skipping hidden folders + # Skipping hidden and excluded folders for dirname in dirnames.copy(): if dirname.startswith("."): dirnames.remove(dirname) + if os.path.join(dirpath, dirname).startswith(excludes): + dirnames.remove(dirname) - def _check_folders(self, folders: list): + def _check_folders(self, folders: list, excludes: tuple[str]): show_message = False pattern = re.compile(SOURCE_CODE_DIR_PATTERN) for folder in folders: for dirpath, dirnames, filenames in os.walk(folder): - self._filter_lint_directories(dirnames) + self._filter_lint_directories(dirpath, dirnames, excludes) for dirname in dirnames: if not pattern.match(dirname): @@ -61,11 +65,11 @@ def _check_folders(self, folders: list): "Folders are not renamed automatically, please fix it by yourself" ) - def _find_sources(self, folders: list): + def _find_sources(self, folders: list, excludes: tuple[str]): output = [] for folder in folders: for dirpath, dirnames, filenames in os.walk(folder): - self._filter_lint_directories(dirnames) + self._filter_lint_directories(dirpath, dirnames, excludes) for filename in filenames: ext = os.path.splitext(filename.lower())[1] @@ -168,14 +172,20 @@ def _apply_file_permissions(self, sources: list, dry_run: bool = False): def _perform(self, dry_run: bool): result = 0 - sources = self._find_sources(self.args.input) + excludes = [] + for folder in self.args.input.copy(): + if folder.startswith("!"): + excludes.append(folder.removeprefix("!")) + self.args.input.remove(folder) + excludes = tuple(excludes) + sources = self._find_sources(self.args.input, excludes) if not self._format_sources(sources, dry_run=dry_run): result |= 0b001 if not self._apply_file_naming_convention(sources, dry_run=dry_run): result |= 0b010 if not self._apply_file_permissions(sources, dry_run=dry_run): result |= 0b100 - self._check_folders(self.args.input) + self._check_folders(self.args.input, excludes) return result def check(self): From 6258757b55356445ce7c54443479dfafc99d3a3f Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Tue, 10 Dec 2024 05:57:51 +0000 Subject: [PATCH 2/3] FBT: Don't lint some apps --- firmware.scons | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/firmware.scons b/firmware.scons index 77bf84de0d..522181e2f8 100644 --- a/firmware.scons +++ b/firmware.scons @@ -31,6 +31,15 @@ env = ENV.Clone( Dir("applications"), # Not C code Dir("!applications/system/js_app/packages"), + # Frequently updated and very different formatting, painful to merge + Dir("!applications/external/nfc_playlist"), + Dir("!applications/external/flip_library"), + Dir("!applications/external/flip_social"), + Dir("!applications/external/flip_store"), + Dir("!applications/external/flip_trader"), + Dir("!applications/external/flip_weather"), + Dir("!applications/external/flip_wifi"), + Dir("!applications/external/web_crawler"), ], LIBPATH=[ "${LIB_DIST_DIR}", From ef05ee44c98a8499643539bd0771ecf3f23db317 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Tue, 10 Dec 2024 06:56:59 +0000 Subject: [PATCH 3/3] Update apps - Chess: Fix illegal move bug (by 956MB) - ESP Flasher: Update Marauder bins to 1.1.0 (by justcallmekoko) - FlipLibrary: Wikipedia, dog facts, random quotes, weather, asset price, predictions, trivia, advice, uuid and many more (by jblanked), holidays (by jamisonderek) - FlipSocial: Loading screens, memory fixes, bio and friend counts, search contacts (by jblanked), RPC_KEYBOAARD support (by jamisonderek) - FlipStore: Memory fixes, update Marauder (by jblanked), more improvements (by jamisonderek) - FlipWiFi: Fix crash when saving networks manually (by jblanked) - MetroFlip: Add Navigo parser, update Rav-Kav with transaction logs, bug fixes (by luu176) - Pinball0: Turbo boosts, signals for improved gameplay, bugfixes (by rdefeo) - WiFi Marauder: AirTag Spoof, flipper blespam, sniff airtag and flipper, list airtag (by 0xchocolate) - UL: Unitemp: Fixed handling of hPa units (by shininghero) --- CHANGELOG.md | 17 ++++++++++------- applications/external | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da06a033c8..faa5a49a41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,19 +8,22 @@ ### Updated: - Apps: - BT/USB Remote: Add PTT support for Gather (by @SapphicCode) - - ESP Flasher: Add c3 and c6 to s3 option (by @jaylikesbunda) - - FlipLibrary: Added Wikipedia, dog facts and random quotes, bug fixes (by @jblanked), connectivity and progress improvements (by @jamisonderek) - - FlipSocial: Improved authentication (by @jblanked) - - FlipStore: Many bugfixes, support ESP32 firmware downloads, allow deleting apps (by @jblanked) + - Chess: Fix illegal move bug (by @956MB) + - ESP Flasher: Add c3 and c6 to s3 option (by @jaylikesbunda), update Marauder bins to 1.1.0 (by @justcallmekoko) + - FlipBIP: Refactor to make adding coins easier (by @xtruan) + - FlipLibrary: Wikipedia, dog facts, random quotes, weather, asset price, predictions, trivia, advice, uuid and many more, bug fixes (by @jblanked), holidays, improvements to connectivity and progress (by @jamisonderek) + - FlipSocial: Improved authentication, loading screens, memory fixes, bio and friend counts, search contacts (by @jblanked), RPC_KEYBOAARD support (by @jamisonderek) + - FlipStore: Many bugfixes, support ESP32 firmware downloads, allow deleting apps, memory fixes, update Marauder (by @jblanked), more improvements (by @jamisonderek) - FlipTrader: Improved progress display, added connectivity check on startup (by @jamisonderek) - FlipWeather: Stability improvements (by @jblanked), improved progress display, added connectivity check on startup (by @jamisonderek) - - FlipWiFi: Improved error handling, updated scan loading and parsing (by @jblanked), added connectivity check on startup (by @jamisonderek) - - FlipBIP: Refactor to make adding coins easier (by @xtruan) - - uPython: Enabled extra functions for the `random` module (by @ofabel) + - FlipWiFi: Improve error handling, update scan loading and parsing, fix crash when saving networks manually (by @jblanked), add connectivity check on startup (by @jamisonderek) - Pokemon Trade Tool: Update to gblink v0.63 which includes saving/loading of pin configurations for the EXT link interface (by @kbembedded) - Snake 2.0: Progress saving, endless mode, game timer, fruit positioning bugfixes (by @Willzvul) + - uPython: Enabled extra functions for the `random` module (by @ofabel) - WebCrawler: Improved progress display, added connectivity check on startup (by @jamisonderek) + - WiFi Marauder: AirTag Spoof, flipper blespam, sniff airtag and flipper, list airtag (by @0xchocolate) - UL: NFC Magic: Added possibility to write 7b MFC to Gen1 tags (by @mishamyte) + - UL: Unitemp: Fixed handling of hPa units (by @shininghero) - UL: Fixed apps for firmware USB CDC callback changes (by @xMasterX) - NFC: - OFW: Replace mf_classic_dict.nfc with Proxmark3 version (by @onovy) diff --git a/applications/external b/applications/external index 1163b58398..2a7953ffcd 160000 --- a/applications/external +++ b/applications/external @@ -1 +1 @@ -Subproject commit 1163b5839883072526c029f9f636507b7f318f14 +Subproject commit 2a7953ffcd63e2b8dc4324379f8b0c5ddbbaaff8