sparkfun / SparkFun_Qwiic_OpenLog_Arduino_Library

Control the I2C based Qwiic OpenLog with ease! This library makes reading, writing, and even arithmetic easy.
Other
17 stars 9 forks source link

Use correct separator in keywords.txt #1

Closed per1234 closed 6 years ago

per1234 commented 6 years ago

The Arduino IDE currently requires the use of a tab separator between the name and identifier. Without this tab the keyword is not highlighted.

Reference: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#keywords

nseidle commented 6 years ago

Thanks!

nseidle commented 6 years ago

Whoops. There's a bigger typo that I need to fix.

nseidle commented 6 years ago

I'm amazed, how did you find that error so quickly? I'm guessing you have scripts that scan all the proposed additions to the lib manager?

per1234 commented 6 years ago

Oops, I didn't check whether the keyword was actually relevant to this library. Well, at least it brought it to your attention.

I have no script as of yet, though I do have one planned. I check each library to make sure it meets the Library Manager inclusion requirements before labeling the issue and while I'm at it I check for a couple other common issues such as the keywords separator.

BTW, the Arduino IDE requires a single true tab separator between keyword and identifier. Multiple tabs do appear to work because the Arduino IDE defaults to editor.function.style for unrecognized keyword identifiers and it just sees the empty field after the first tab as an unrecognized identifier: image

In this keywords.txt the only difference this causes is that OpenLog is not bold: image vs. the keywords with single tab separators: image A similar problem occurs if there is a space between the separator and the identifier. The space is seen as part of the identifier and causes it to be unrecognized. Several of this library's keywords have this but it doesn't actually matter in this case since the fallback keywords style happens to be the same as the intended style.

nseidle commented 6 years ago

I had to turn on all symbols in NP++ to see the extra chars. Thanks! I'll get that corrected and try to use it as the template for future SparkFun libs.

per1234 commented 6 years ago

I finished the aforementioned script and have been using it for a while now.

This is the script that detects common problems with libraries: https://github.com/per1234/arduino-ci-script (specifically the check_keywords_txt, check_library_properties, check_library_structure, and check_library_manager_compliancefunctions)

This is the script that automatically generates a list of all the Arduino libraries on GitHub: https://github.com/per1234/inoliblist

This is the script that runs the first script on all the libraries in the list: https://github.com/per1234/inolibbuglist

It was an interesting project.

nseidle commented 6 years ago

This is really neat! Nice work!