Skip to content

Commit

Permalink
check_folder_name: Don't say "ERROR" in the output
Browse files Browse the repository at this point in the history
check_library_properties uses check_folder_name, but only to display warnings. Thus, the use of "ERROR" in the check_folder_name output resulted in incorrect output from check_library_properties.
  • Loading branch information
per1234 committed Jun 14, 2019
1 parent 8311df7 commit c73b5eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ matrix:
- cd ..
- git clone https://github.com/per1234/arduino-ci-script-tests
- cd arduino-ci-script-tests
- git checkout 573daca37f80a720b9e097de21ddc7d69c0b46f4
- git checkout d9c33763ccde4467f43e1a5ddb8632e0575e6c3e
script:
- bats check_keywords_txt.bats
- bats check_library_manager_compliance.bats
Expand Down
8 changes: 5 additions & 3 deletions arduino-ci-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1232,20 +1232,20 @@ function check_folder_name() {
# Starting folder name with a - or . is not allowed
local -r startsWithInvalidCharacterRegex="^[-.]"
if [[ "$folderName" =~ $startsWithInvalidCharacterRegex ]]; then
echo "ERROR: Invalid folder name: ${folderName}. Folder name beginning with a - or . is not allowed."
echo "Invalid folder name: ${folderName}. Folder name beginning with a - or . is not allowed."
exitStatus=$(set_exit_status "$exitStatus" $ARDUINO_CI_SCRIPT_CHECK_FOLDER_NAME_INVALID_FIRST_CHARACTER_EXIT_STATUS)
fi

# Allowed characters: a-z, A-Z, 0-1, -._
local -r disallowedCharactersRegex="[^a-zA-Z0-9._-]"
if [[ "$folderName" =~ $disallowedCharactersRegex ]]; then
echo "ERROR: Invalid folder name: ${folderName}. Only letters, numbers, dots, dashes, and underscores are allowed."
echo "Invalid folder name: ${folderName}. Only letters, numbers, dots, dashes, and underscores are allowed."
exitStatus=$(set_exit_status "$exitStatus" $ARDUINO_CI_SCRIPT_CHECK_FOLDER_NAME_INVALID_CHARACTER_EXIT_STATUS)
fi

# <64 characters
if [[ ${#folderName} -gt 63 ]]; then
echo "ERROR: Folder name $folderName exceeds the maximum of 63 characters."
echo "Folder name $folderName exceeds the maximum of 63 characters."
exitStatus=$(set_exit_status "$exitStatus" $ARDUINO_CI_SCRIPT_CHECK_FOLDER_NAME_TOO_LONG_EXIT_STATUS)
fi
return "$exitStatus"
Expand Down Expand Up @@ -1347,6 +1347,7 @@ function check_sketch_structure() {
check_folder_name "$sketchPath"
local checkFolderNameExitStatus=$?
if [[ $checkFolderNameExitStatus -ne $ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS ]]; then
echo "ERROR: ${sketchPath}: Invalid folder name."
exitStatus=$(set_exit_status "$exitStatus" $((ARDUINO_CI_SCRIPT_CHECK_SKETCH_STRUCTURE_CHECK_FOLDER_NAME_OFFSET + checkFolderNameExitStatus)))
fi

Expand Down Expand Up @@ -1435,6 +1436,7 @@ function check_library_structure() {
check_folder_name "$normalizedLibraryPath"
local checkFolderNameExitStatus=$?
if [[ $checkFolderNameExitStatus -ne $ARDUINO_CI_SCRIPT_SUCCESS_EXIT_STATUS ]]; then
echo "ERROR: ${normalizedLibraryPath}: Invalid folder name."
exitStatus=$(set_exit_status "$exitStatus" $((ARDUINO_CI_SCRIPT_CHECK_LIBRARY_STRUCTURE_CHECK_FOLDER_NAME_OFFSET + checkFolderNameExitStatus)))
fi

Expand Down

6 comments on commit c73b5eb

@arduino-ci-script-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arduino-ci-script-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once completed, the job reports for Travis CI build 903 will be found at:
https://github.com/per1234/CI-reports/tree/arduino-ci-script/build_00903

@arduino-ci-script-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arduino-ci-script-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once completed, the job reports for Travis CI build 905 will be found at:
https://github.com/per1234/CI-reports/tree/arduino-ci-script/build_00905

@arduino-ci-script-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arduino-ci-script-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once completed, the job reports for Travis CI build 906 will be found at:
https://github.com/per1234/CI-reports/tree/arduino-ci-script/build_00906

Please sign in to comment.