PlummersSoftwareLLC / NightDriverStrip

NightDriver client for ESP32
https://plummerssoftwarellc.github.io/NightDriverStrip/
GNU General Public License v3.0
1.29k stars 210 forks source link

Fix file type error in show_features.py #620

Closed robertlipe closed 2 months ago

robertlipe commented 2 months ago

Running show_features.py on systems not clinging to CP/M conventions results in an error because hash-pling env python^M fails as that is parsed as carriage return.

➜ nightdriverstrip git:(s3-work) ✗ tools/show_features.py env: python\r: No such file or directory

There may be some clever way to force this in git, but I "fixed" the source file thusly: vim -b $FILE; s/^V^M//g

Tested:

➜ nightdriverstrip git:(s3-work) ✗ tools/show_features.py Fetching features for environment demo Fetching features for environment m5demo Fetching features for environment m5plusdemo Fetching features for environment heltecdemo Fetching features for environment heltecv2demo [ ... ] "fanset": [ "wifi", "webserver", "remote", "audio" ], "cube": [ "wifi", "webserver", "socketserver", "colorserver", "audio", "ntp" ] }

Success!

You can convince yourself there's nothing sneaky in this PR by doing an online diff and seeing that every line looks like it's changed, but then clicking "ignore whitespace" and seeign that zero lines have been changed. Edit: That's https://github.com/PlummersSoftwareLLC/NightDriverStrip/pull/620/files [ all lines look changed. Contrast ... ] https://github.com/PlummersSoftwareLLC/NightDriverStrip/pull/620/files?diff=split&w=1 [ look ma, no changes ]

Given the recent interest in sneaky-looking binary file changes, I wanted to shore up trust on this.

Description

Contributing requirements

robertlipe commented 2 months ago

Edited to include diff instructions.

TBC: I have zero emotional investment in this glorified search and replace. The value is in the legwork. If a Python or Git expert (I claim to be neither) has some better way to fix this, I'm happy to let this go and validate an alternative PR.

I see now that tools/build_all.py has the same issue. I'm happy to add that file to this PR, open a new PR, or await guidance on some way to never have to manually care about this esoterica again.

$ file tools/* | grep CRLF tools/-defines-.cpp: C source, ASCII text, with CRLF line terminators tools/build_all.py: Python script, ASCII text executable, with CRLF line terminators ➜ nightdriverstrip git:(s3-work) ✗ tools/build_all.py env: python\r: No such file or directory ➜ nightdriverstrip git:(s3-work) ✗

rbergen commented 2 months ago

@robertlipe Good catch! I've actually gone through a number of other files (including the other Python scripts and the JSON files) and consistently made them use LF line endings. I'll push my changes to this PR in a minute.