Skip to content

Correct messages regarding sketch/library folder name restrictions #7734

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

Merged
merged 1 commit into from
Aug 10, 2018
Merged

Correct messages regarding sketch/library folder name restrictions #7734

merged 1 commit into from
Aug 10, 2018

Conversation

per1234
Copy link
Collaborator

@per1234 per1234 commented Jun 27, 2018

  • Specify that library name error is about folder name.
    • We would normally expect "library name" to mean the "fancy name" (as defined by the library.properties name field).
  • Specify exactly which characters are allowed.
  • State that spaces are prohibited in sketch folder name.
  • Make sketch and library messages consistent.
  • Remove outdated message about library folders not being allowed to start with a number.
    • This restriction was removed by 4545283).
  • State library folder name length restriction.

Fixes #7613

tr("The sketch name had to be modified. Sketch names can only consist\n" +
"of ASCII characters and numbers and be less than 64 characters long.");
tr("The sketch name had to be modified. Sketch names can only consist of\n" +
"ASCII characters and numbers, no spaces, and be less than 64 characters long.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this really correct? ASCII characters would include all 128 defined ASCII characters, but the actual limits are smaller: https://github.com/per1234/Arduino/blob/9edfa14531a9d184e36cc5761d4b18984daa3d1b/arduino-core/src/processing/app/BaseNoGui.java#L853-L857

Perhaps this message should just spell out the requirements exactly: A letter or number, followed by letters, numbers, dashes, dots and underscores (underscores are not listed in the whitelist, but anything else is replaced by an underscore, making the underscore implicitly allowed). Maximum length is 63 characters.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Great idea. Thanks! I have implemented your suggestion via a force push. I ended up just squashing everything into a single commit since it ends up being a complete rewrite of both messages, rather than changing some specific wording. I like the use of the same wording in both messages, which should make any future changes to them easier. I suppose it would be best practices to just share the same string between the two so they never again get out of sync? Anyway, that's beyond my skills.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@matthijskooijman when you get some time, please check my changes to see if this PR now meets your approval. Thanks!

+ "Library names must contain only basic letters and numbers.\n"
+ "(ASCII only and no spaces, and it cannot start with a number)"),
+ "Library folder names must contain only basic letters and numbers\n"
+ "(ASCII only and no spaces), and be less than 64 characters long."),
Copy link
Collaborator

Choose a reason for hiding this comment

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

The same constraints hold here.

Copy link
Collaborator

@matthijskooijman matthijskooijman left a comment

Choose a reason for hiding this comment

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

Looks good to me now. Two more nitpicks:

  • There is a missing opening parenthesis in - This restriction was removed by 4545283).
  • I would suggest a slight rewording: "Sketch names must start with a letter or number, followed by...". IMO this makes it more clear that the letter or number is about the first character only.

- Specify that library name error is about folder name.
  - We would normally expect "library name" to mean the "fancy name" (as defined by the library.properties name field).
- Specify exactly which characters are allowed.
- State that spaces are prohibited in sketch folder name.
- Remove outdated message about library folders not being allowed to start with a number.
  - This restriction was removed by 4545283.
- State library folder name length restriction.
- Make sketch and library messages consistent with each other.
@per1234
Copy link
Collaborator Author

per1234 commented Jul 11, 2018

"Nitpicks" resolved via a force push.

I also like that wording better for the messages.

I appreciate your attention to detail regarding clean commits and clean commit messages. One of your comments years ago brought these concepts to my awareness. As someone who regularly ends up digging around through commit histories trying to understand the purpose of some code I really get why it matters.

@matthijskooijman
Copy link
Collaborator

I appreciate your attention to detail regarding clean commits and clean commit messages. One of your comments years ago brought these concepts to my awareness. As someone who regularly ends up digging around through commit histories trying to understand the purpose of some code I really get why it matters.

:-D

@cmaglie cmaglie merged commit 19bfd2a into arduino:master Aug 10, 2018
@cmaglie cmaglie added this to the Release 1.8.6 milestone Aug 10, 2018
@per1234 per1234 deleted the update-library-name-error branch August 10, 2018 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants