Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ§‘β€πŸ’» Add validate-pins workflow for PRs #26996

Merged

Conversation

sjasonsmith
Copy link
Contributor

@sjasonsmith sjasonsmith commented Apr 22, 2024

Description

Adding an automated pins file validation check will alleviate burden from reviewers, and provide immediate feedback to contributors. This runs in a parallel manner, only taking a few seconds to check all files.

This consisted of several changes:

  1. Update pinsformat.py to ensure a space is included if needed when concatenating certains strings. This mirrors the changes made several months ago in the Javascript version in πŸ§‘β€πŸ’» Update pin formatting toolsΒ #26450
  2. Delete pinsformat.js, in order to standardize on Python for tools and eliminate the need to fix issues in both.
  3. Add a make validate-pins option to the Makefile, which fails if format-pins makes any changes.
  4. Add a github workflow to run make validate-pins automatically on pull requests that touch pins files

Description of output

This will always process all files, so that a complete summary of failures will be provided in the log. The log contains:

  1. The git diff output of all modified files. Running in the workflow, this should only be the modified pins files.
  2. The git status output, providing a concise list of files which were modified.

Sample of output

(Note that in this case pinsformat is actually breaking the code, that will need to be fixed before this is merged)

diff --git a/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h
index 1d63f40..7dc195b 100644
--- a/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h
+++ b/Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h
@@ -538,7 +538,7 @@
       #define TFT_RESET_PIN          EXP1_04_PIN
 
       #define LCD_BACKLIGHT_PIN      EXP1_03_PIN
-      #define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN
+      #define TFT_BACKLIGHT_PINLCD_BACKLIGHT_PIN
 
       #define TOUCH_BUTTONS_HW_SPI
       #define TOUCH_BUTTONS_HW_SPI_DEVICE      1
HEAD detached at pull/26996/merge
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   Marlin/src/pins/lpc1768/pins_MKS_SBASE.h
	modified:   Marlin/src/pins/ramps/pins_RAMPS.h
	modified:   Marlin/src/pins/sanguino/pins_MELZI_CREALITY.h
	modified:   Marlin/src/pins/sanguino/pins_SANGUINOLOLU_11.h
	modified:   Marlin/src/pins/stm32f1/pins_LONGER3D_LK.h
	modified:   Marlin/src/pins/stm32h7/pins_BTT_SKR_V3_0_common.h

no changes added to commit (use "git add" and/or "git commit -a")

Error: Pins files are not formatted correctly. Run "make format-pins" to fix.

@sjasonsmith sjasonsmith changed the title Pr/format pins action βœ… Add validate-pins github workflow for PRs Apr 22, 2024
@sjasonsmith sjasonsmith changed the title βœ… Add validate-pins github workflow for PRs βœ… Add validate-pins workflow for PRs Apr 22, 2024
@sjasonsmith sjasonsmith changed the title βœ… Add validate-pins workflow for PRs πŸ§‘β€πŸ’» Add validate-pins workflow for PRs Apr 22, 2024
@sjasonsmith sjasonsmith marked this pull request as ready for review April 22, 2024 05:02
@thinkyhead thinkyhead added the T: Development Makefiles, PlatformIO, Python scripts, etc. label Apr 23, 2024
@thinkyhead thinkyhead merged commit 247e989 into MarlinFirmware:bugfix-2.1.x Apr 23, 2024
62 checks passed
mikezs added a commit to mikezs/Marlin that referenced this pull request Apr 26, 2024
* bugfix-2.1.x: (111 commits)
  [cron] Bump distribution date (2024-04-25)
  🩹 IA-Creality minor cleanup
  🩹 Simple IA-Creality babystep patch
  🚸 Fix duplicate temperature report (MarlinFirmware#26952)
  [cron] Bump distribution date (2024-04-24)
  ✏️ MPCTEMP_START => MPC_STARTED (MarlinFirmware#27002)
  πŸ”§ BIQU MicroProbe V2 pull-up warning (MarlinFirmware#27008)
  🎨 Format pins which fail validation (MarlinFirmware#27007)
  βœ…  CI - Validate Pins Formatting (MarlinFirmware#26996)
  [cron] Bump distribution date (2024-04-23)
  🎨 Clean up after recent PRs
  [cron] Bump distribution date (2024-04-22)
  πŸ› Fix Flags<N> data storage width (MarlinFirmware#26995)
  βœ… Add additional unit tests for types.h (MarlinFirmware#26994)
  βœ… Unit test improvements (MarlinFirmware#26993)
  πŸ”§ Add RAMPS TMC SPI pins when !TMC_USE_SW_SPI (MarlinFirmware#26960)
  πŸ› Fix PID upon entering PID_FUNCTIONAL_RANGE (MarlinFirmware#26926)
  [cron] Bump distribution date (2024-04-21)
  🎨Match unit test folder structure to code (MarlinFirmware#26990)
  βœ… Skip compile tests when editing unit tests (MarlinFirmware#26991)
  ...
RPGFabi pushed a commit to RPGFabi/Marlin that referenced this pull request Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: Development Makefiles, PlatformIO, Python scripts, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants