You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if [[ "$(find "$normalizedKeywordsTxtPath" -type f -iname 'keyword.txt')"||"$(find "$normalizedKeywordsTxtPath" -type f -iregex '.*/keywords?\.text')"||"$(find "$normalizedKeywordsTxtPath" -type f -iregex '.*/keywords?\.txt\.txt')" ]];then
2055
-
echo"ERROR: $normalizedKeywordsTxtPath contains an incorrectly spelled keywords.txt file."
2055
+
echo"ERROR: ${normalizedKeywordsTxtPath}: Incorrectly spelled keywords.txt file. It must be spelled exactly \"keywords.txt\"."
@@ -2067,7 +2067,7 @@ function check_keywords_txt() {
2067
2067
if [[ "${foundKeywordsTxtPath: -12}"=='keywords.txt' ]];then
2068
2068
keywordsTxtFound=true
2069
2069
else
2070
-
echo"ERROR: $foundKeywordsTxtPath has incorrect filename case, which causes it to not be recognized on a filename case-sensitive OS such as Linux. It must be exactly keywords.txt"
2070
+
echo"ERROR: ${foundKeywordsTxtPath}: Incorrect filename case, which causes it to not be recognized on a filename case-sensitive OS such as Linux. It must be exactly \"keywords.txt\"."
done<<<"$(find "$normalizedKeywordsTxtPath" -maxdepth 1 -type f -iname 'keywords.txt')"
@@ -2095,15 +2095,16 @@ function check_keywords_txt() {
2095
2095
local BOMcorruptedCommentRegex='^.[[:space:]]*#'
2096
2096
local BOMcorruptedBlankLineRegex='^.[[:space:]]*$'
2097
2097
if [[ "$keywordsTxtLine"=~$BOMcorruptedCommentRegex ]] || [[ "$keywordsTxtLine"=~$BOMcorruptedBlankLineRegex ]];then
2098
-
echo"WARNING: BOM found. In this case it does not cause an issue but it's recommended to use UTF-8 encoding for keywords.txt."
2098
+
echo"WARNING: ${normalizedKeywordsTxtPath}/keywords.txt: BOM found. In this case it does not cause an issue but it's recommended to use UTF-8 encoding for keywords.txt."
2099
2099
continue
2100
2100
fi
2101
2101
fi
2102
2102
2103
2103
local spacesSeparatorRegex='^[[:space:]]*[^[:space:]]+ +[^[:space:]]+'
2104
2104
# Check for invalid separator
2105
2105
if [[ "$keywordsTxtLine"=~$spacesSeparatorRegex ]];then
2106
-
echo"ERROR: $normalizedKeywordsTxtPath (${keywordsTxtLine}) uses space(s) as a field separator. It must be a true tab."
2106
+
echo"ERROR: ${normalizedKeywordsTxtPath}/keywords.txt: Space(s) used as a field separator. Fields must be separated by a single true tab."
# The rest of the checks will be borked by messed up field separators so continue to the next line
2109
2110
continue
@@ -2112,7 +2113,8 @@ function check_keywords_txt() {
2112
2113
# Check for multiple tabs used as separator where this causes unintended results
2113
2114
local consequentialMultipleSeparatorRegex='^[[:space:]]*[^[:space:]]+[[:space:]]*'$'\t''+[[:space:]]*'$'\t''+[[:space:]]*((KEYWORD1)|(LITERAL1))'
2114
2115
if [[ "$keywordsTxtLine"=~$consequentialMultipleSeparatorRegex ]];then
2115
-
echo"ERROR: $normalizedKeywordsTxtPath (${keywordsTxtLine}) uses multiple tabs as field separator. It must be a single tab. This causes the default keyword highlighting (as used by KEYWORD2, KEYWORD3, LITERAL2) to be used rather than the intended highlighting."
2116
+
echo"ERROR: ${normalizedKeywordsTxtPath}/keywords.txt: Multiple tabs used as field separator. It must be a single tab. This causes the default keyword highlighting (as used by KEYWORD2, KEYWORD3, LITERAL2) to be used rather than the intended highlighting."
# The rest of the checks will be borked by messed up field separators so continue to the next line
2118
2120
continue
@@ -2121,7 +2123,8 @@ function check_keywords_txt() {
2121
2123
# Check for multiple tabs used as separator where this causes no unintended results
2122
2124
local inconsequentialMultipleSeparatorRegex='^[[:space:]]*[^[:space:]]+[[:space:]]*'$'\t''+[[:space:]]*'$'\t''+[[:space:]]*((KEYWORD2)|(KEYWORD3)|(LITERAL2))'
2123
2125
if [[ "$keywordsTxtLine"=~$inconsequentialMultipleSeparatorRegex ]];then
2124
-
echo"ERROR: $normalizedKeywordsTxtPath (${keywordsTxtLine}) uses multiple tabs as field separator. It must be a single tab. This causes the default keyword highlighting (as used by KEYWORD2, KEYWORD3, LITERAL2). In this case that doesn't cause the keywords to be incorrectly colored as expected but it's recommended to fully comply with the Arduino library specification."
2126
+
echo"ERROR: ${normalizedKeywordsTxtPath}/keywords.txt: Multiple tabs used as field separator. It must be a single tab. This causes the default keyword highlighting (as used by KEYWORD2, KEYWORD3, LITERAL2). In this case that doesn't cause the keywords to be colored other than intended but it's recommended to fully comply with the Arduino library specification."
# The rest of the checks will be borked by messed up field separators so continue to the next line
2127
2130
continue
@@ -2130,7 +2133,8 @@ function check_keywords_txt() {
2130
2133
# Check for invalid line
2131
2134
local invalidLineRegex='^[[:space:]]*[^[:space:]]+[[:space:]]*$'
2132
2135
if [[ "$keywordsTxtLine"=~$invalidLineRegex ]];then
2133
-
echo"ERROR: $normalizedKeywordsTxtPath has an invalid line: ${keywordsTxtLine}. If this was intended as a comment, it should use the correct # syntax."
2136
+
echo"ERROR: ${normalizedKeywordsTxtPath}/keywords.txt: Invalid line. If this was intended as a comment, it should use the correct # syntax."
# The rest of the checks are pointless so continue to the next line of keywords.txt
2136
2140
continue
@@ -2176,12 +2180,13 @@ function check_keywords_txt() {
2176
2180
allowedKeywordCharactersRegex='^[a-zA-Z0-9_]+$'
2177
2181
# Check for corruption of KEYWORD field caused by UTF-8 BOM file encoding
2178
2182
if grep --quiet $'\xEF\xBB\xBF'<<<"$keyword";then
2179
-
echo"ERROR: $normalizedKeywordsTxtPath uses UTF-8 BOM file encoding, which has corrupted the first keyword definition. Please change the file encoding to standard UTF-8."
2183
+
echo"ERROR: ${normalizedKeywordsTxtPath}/keywords.txt: UTF-8 BOM file encoding has corrupted the first keyword definition. Please change the file encoding to standard UTF-8."
# The Arduino IDE does recognize keywords that start with a number, even though these are not valid identifiers.
2184
-
echo"ERROR: Keyword $keyword in $normalizedKeywordsTxtPath contains invalid character(s), which causes it to not be recognized by the Arduino IDE. Keywords may only contain the characters a-z, A-Z, 0-9, and _."
2188
+
echo"ERROR: ${normalizedKeywordsTxtPath}/keywords.txt: Keyword: $keyword contains invalid character(s), which causes it to not be recognized by the Arduino IDE. Keywords may only contain the characters a-z, A-Z, 0-9, and _."
@@ -2195,15 +2200,18 @@ function check_keywords_txt() {
2195
2200
# Check if the issue doesn't cause any change from the intended highlighting
2196
2201
local inconsequentialTokentypeRegex='((KEYWORD2)|(KEYWORD3)|(LITERAL2))'
2197
2202
if [[ "$keywordTokentypeWithoutLeadingSpace"=~$inconsequentialTokentypeRegex ]];then
2198
-
echo"ERROR: $normalizedKeywordsTxtPath (${keywordsTxtLine}) has leading space on the KEYWORD_TOKENTYPE field, which causes it to not be recognized, so the default keyword highlighting is used. In this case that doesn't cause the keywords to be incorrectly colored as expected but it's recommended to fully comply with the Arduino library specification."
2203
+
echo"ERROR: ${normalizedKeywordsTxtPath}/keywords.txt: Leading space on the KEYWORD_TOKENTYPE field causes it to not be recognized, so the default keyword highlighting is used. In this case that doesn't cause the keywords to be colored other than intended but it's recommended to fully comply with the Arduino library specification."
echo"ERROR: $normalizedKeywordsTxtPath (${keywordsTxtLine}) has leading space on the KEYWORD_TOKENTYPE field, which causes it to not be recognized, so the default keyword highlighting is used."
2207
+
echo"ERROR: ${normalizedKeywordsTxtPath}/keywords.txt: Leading space on the KEYWORD_TOKENTYPE field causes it to not be recognized, so the default keyword highlighting is used."
# It's reasonable to leave KEYWORD_TOKENTYPE blank if RSYNTAXTEXTAREA_TOKENTYPE is defined and valid. This will not be compatible with 1.6.4 and older but that's really no big deal.
2206
-
echo"ERROR: $normalizedKeywordsTxtPath (${keywordsTxtLine}) uses invalid KEYWORD_TOKENTYPE: ${keywordTokentype}, which causes the default keyword highlighting to be used. See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#keyword_tokentype"
2213
+
echo"ERROR: ${normalizedKeywordsTxtPath}/keywords.txt: Invalid KEYWORD_TOKENTYPE: $keywordTokentype causes the default keyword highlighting to be used. See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#keyword_tokentype"
if [[ !$(find "${ARDUINO_CI_SCRIPT_APPLICATION_FOLDER}/${ARDUINO_CI_SCRIPT_IDE_INSTALLATION_FOLDER}/reference/www.arduino.cc/en/Reference/" -type f -name "${referenceLink}.html") ]];then
2219
-
echo"ERROR: $normalizedKeywordsTxtPath (${keywordsTxtLine}) uses a REFERENCE_LINK value: $referenceLink that is not a valid Arduino Language Reference page. See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#reference_link"
2227
+
echo"ERROR: ${normalizedKeywordsTxtPath}/keywords.txt: REFERENCE_LINK value: $referenceLink is not a valid Arduino Language Reference page. See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#reference_link"
@@ -2228,10 +2237,12 @@ function check_keywords_txt() {
2228
2237
# Check if it's invalid only because of leading space
2229
2238
local rsyntaxtextareaTokentypeWithoutLeadingSpace="${rsyntaxtextareaTokentype#"${rsyntaxtextareaTokentype%%[![:space:]]*}"}"
2230
2239
if [[ "$rsyntaxtextareaTokentypeWithoutLeadingSpace"=~$validRsyntaxtextareaTokentypeRegex ]];then
2231
-
echo"ERROR: $normalizedKeywordsTxtPath (${keywordsTxtLine}) has leading space on the RSYNTAXTEXTAREA_TOKENTYPE field, which causes it to not be recognized, so the default keyword highlighting is used."
2240
+
echo"ERROR: ${normalizedKeywordsTxtPath}/keywords.txt: Leading space on the RSYNTAXTEXTAREA_TOKENTYPE field causes it to not be recognized, so the default keyword highlighting is used."
echo"ERROR: $normalizedKeywordsTxtPath (${keywordsTxtLine}) uses invalid RSYNTAXTEXTAREA_TOKENTYPE: ${rsyntaxtextareaTokentype}, which causes the default keyword highlighting to be used. See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#rsyntaxtextarea_tokentype"
2244
+
echo"ERROR: ${normalizedKeywordsTxtPath}/keywords.txt: Invalid RSYNTAXTEXTAREA_TOKENTYPE: $rsyntaxtextareaTokentype causes the default keyword highlighting to be used. See: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#rsyntaxtextarea_tokentype"
0 commit comments