-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Update boards.txt file to fix some of the broken board.build entries that should be upper case #7942
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
Conversation
Fix some of the board.build entries that are lower case to make the upper case
|
If you're going to fix some of them, seems like you might just fix them all? Here are the remaining ones:
|
@FrightRisk I couldn't find a commit that specifically made those entries lower case. It looks like they were originally lower case when added. I agree constants should be fully uppercase. Most of the |
#4577 made the heltec ones lowercase |
Now that's digging deep. Nice catch! |
Happy to do the rest. I wasn't sure about a couple of them, though I thought they should all be in caps, you guys confirmed it. I can update the PR Thursday sometime. It is Wednesday night for me now. Here are some I wasn't sure of because I don't know what "revisions" means and if I should change anything that has build.board in it ttgo-lora32.build.board=TTGO_LoRa32 ttgo-lora32.menu.Revision.TTGO_LoRa32_V1=TTGO LoRa32 V1 (No TFCard) ttgo-lora32.menu.Revision.TTGO_LoRa32_V2=TTGO LoRa32 V2 ttgo-lora32.menu.Revision.TTGO_LoRa32_v21new=TTGO LoRa32 V2.1 (1.6.1) |
Still unclear about several other lower case boards like a LoRa and "Pocket32", the grep doesn't seem to show them, but they are there. Should I change every build.board entry to upper case? |
I would if for no other reason than to be consistent across the board on what the |
Good point, here's a better regex. It will find boards with any lowercase or
|
Make all build.board entries consistent with all caps and underscores instead of dashes
Yes, I fixed the dashes too when I saw those. I see "variants" and left those alone though some have dashes and some have underscores |
The |
Fix spelling and remove line spacing added by mistake
Fix last 2 boards including fixing the Lionbit board entry
Ok, I think I am good then. All the build boards are uppercase and all use underscores. I also changed the Lion:Bit board. It is referenced elsewhere as "lionbit" and I don't think there should be colons in constants, so made it LIONBIT_DEV_BOARD. I believe it is read for review. |
@P-R-O-C-H-Y Please review this PR. |
Wouldn't changing ALL boards now cause other conditional statements to fail? I know for a fact that M5 have some conditions that depends on the correct name as-is |
I guess that decision rests with someone above me, but the standard is that these should be all caps and that is what I would vote for. You really can't have a hodge podge mess. I agree that it might break something else if people were used to a constant listed incorrectly, but is a very simple fix to just change to all caps in any existing code. M5 can issue an update. |
@Tinyu-Zhao Can you please take a look if this PR will cause issues for your boards? Thanks |
I will check it,Thanks. |
hi, please don't do this to all boards. as @me-no-dev mentioned, this will break all third party libraries that rely on board names for device detection at compile time, and there are many, I'm only listing here a few ones from memory but I know there are more:
And "the fix is to add an Please consider the tradeoff of being semantically correct vs the workload and the bugs this will generate downstream. |
@tobozo There will be breakages regardless of what is done or not done unfortunately. The mixed case names should never have been included in the first place. I agree the workaround is a bit ugly but perhaps it could be mitigated by adding a board pins variant header that defines the old mixed case version of the define? |
@atanisoft unless I missed a document saying these are the standards, If it is only a convention, then is it required? I'm just weighing the tech debt between following that convention and only fixing the heltect board, and I don't understand why an upper or mixed-case macro is important at this stage or even in the future, please enlighten me.
Although easier to manage that's still a tech debt: trading a global compile flag with a scoped will only affect multidevice libraries/projects who do not explicitely include that header. |
If they include Arduino.h it will be automatically included (I haven't seen any library that doesn't include this header).
Definitely more of a convention than standard, but having a mixed set of pre-compiler constants lacks consistency and style. Is it required, that is up for debate. |
Can we (library maintainers, board vendors, end users) get a vote before such a tech debt is deferred on us or will it just happen whatever we discuss or debate? |
Всем привет🖖 Я вас очень прошу делайте так чтобы я не ушол на покой😔 |
Hi all, we have discussed this internally and also on last Community Meeting and I'm sharing here the approach we come up with.
Please let us know if this make sense for you, we're looking forward for your feedback. |
that's good news, thank you for taking the time to discuss this 👍 |
@VojtechBartoska I agree 100% with this approach. Who is setting up the rule to enforce Upper case naming? |
We can include it into Boards test script to check if the PR meet all the requirements. |
@P-R-O-C-H-Y up to my last comment, will you be able to add one more check to boards.yml to validate if the new board addition use Capital letters? After this modification, we can close this PR. |
OK with upper-case naming, enforcement and standards in this file is great to see! |
We can close this now as the relevant features have already been merged :) |
Fix some of the board.build entries that are lower case to make them upper case. In particular, the Heltec boards were broken in the Arduino IDE with version 2.0.7 or the ESP32 library when they were changed from HELTEC_WIFI_32 to heltec_wifi_32, etc.
Description of Change
Changes many, but not all of the incorrectly lowecase board.build names to be uppercase. When they were changed to lowercase, they broke conditional compiles based on board type. The standard since these are constants, is to be upper case.
Tests scenarios
Arduino IDE 1.8.09 and 2.0.4. Tested with the Heltec wifi board and wifi board v3
Partially fixes issue
Fixes #7943