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

Quick format Python docs #27649

Merged

Conversation

classicrocker883
Copy link
Contributor

Description

I did some quick "Format Document" in VSCode using Microsofts Black Formatter

Of course I had to do some tweaks to keep it kosher.

So far I did .py files in
buildroot/share/PlatformIO/scripts

and a couple in
buildroot/scripts

I'll be finishing the other .py files but so far its a start, and looks much better.

Requirements

Benefits

Puts everything inline how python code should go (spacing wise). Makes readability better, fixes some errors too like random ; typos at the end of code like C++

Configurations

Related Issues

@thinkyhead thinkyhead force-pushed the bugfix-2.1.x-January2 branch from 154924c to bbdd4a0 Compare January 24, 2025 01:26
@thinkyhead
Copy link
Member

thinkyhead commented Jan 24, 2025

Auto-formatters don't work for our purposes because they mess up intentional but "different" formatting choices made by the author. I've retained the changes that help readability. This took a long time to review, which is one reason OSS contribution guidelines (often humorously) counsel against making these kinds of contributions to OSS projects.

@thinkyhead thinkyhead merged commit 0a59807 into MarlinFirmware:bugfix-2.1.x Jan 24, 2025
64 checks passed
@classicrocker883
Copy link
Contributor Author

@thinkyhead quick question:

def err(board, msg):
- print(f'[ERROR] {board:30} {msg}')

def err(board, msg):
+   print(f"[ERROR] {board:30} {msg}")

as you can see the change here replaces ' w/ "
but on line 119 (in validate_boards.py, this remains the same.

print(f'[ERROR] Non-matching boards order in pins.h. Expected {bshort(boards_boards[i])} but got {bshort(pins_boards[i])}')

should these instances like print(f' have ' or ", or does that always depend?

@classicrocker883 classicrocker883 deleted the bugfix-2.1.x-January2 branch January 25, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants