-
-
Notifications
You must be signed in to change notification settings - Fork 395
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
Creation of sketches with non-compliant names is permitted #1599
Comments
I have collected the differences between the spec and how it works in the create editor https://create.arduino.cc/editor: Allowed to start with:
Allowed characters:
Allowed length:
The problem is that the Create API is more restrictive than the spec. Hence, it won't be possible in IDE2 to constantly push any local sketch to the cloud due to the invalid name. To summarize, what is valid and works as a local sketch might not be OK as a remote sketch. I need to know how this was designed to handle in IDE2. Thanks! |
As a proposal, IDE2 can use the spec rules when creating ordinary sketches, and when the user wants to push them, and the name of the sketch does not comply with the Create API naming convention, users must rename it before a push. What do you think, @91volt? Update: Yes. IDE2 has to raise a dialog before the push, and the local sketch will be pushed with a different name: |
I do not think this is always feasible. Example: IDE2 has a valid sketch name, export the sketch to ZIP, still valid, and import it to Create editor, it could be invalid. |
Closes #1599 Signed-off-by: Akos Kitta <[email protected]>
It is absolutely feasible. The Arduino Cloud developers just need to respect the Arduino Sketch Specification. |
Closes #1599 Signed-off-by: Akos Kitta <[email protected]>
IDE2 has to validate the sketch code files besides the main sketch file and the sketch folder. Validation of any new file is trivial; the question was when to validate the sketch code files of existing sketches, how to warn users, and how to guide them to fix the issues. Per and I further refined the requirements of this task and decided to do the following:
For further details on this topic, please reference #1821 (review). |
Closes #1599 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #1826 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #1826 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #1826 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #1826 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #1826 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #1826 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #1826 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #1826 Closes #1847 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #1826 Closes #1847 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #1826 Closes #1847 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #1826 Closes #1847 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #1826 Closes #1847 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #649 Closes #1847 Closes #1882 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Closes #1599 Closes #1825 Closes #649 Closes #1847 Closes #1882 Co-authored-by: Akos Kitta <[email protected]> Co-authored-by: per1234 <[email protected]> Signed-off-by: Akos Kitta <[email protected]>
Describe the problem
The Arduino sketch specification defines the characters allowed for use in sketch folder and file names:
https://arduino.github.io/arduino-cli/dev/sketch-specification/#sketch-folders-and-files
🐛 Arduino IDE allows users to create sketches with non-compliant names
To reproduce
`~!@#$%^&()=+[{]};',
🐛 The IDE allowed the creation of a sketch with non-compliant name.
`~!@#$%^&()=+[{]};',2
🐛 The IDE allowed the creation of an additional sketch file with non-compliant name.
🐛 Compilation fails with a cryptic error:
🐛 A warning dialog is shown on startup:
🐛 The sketch can not be shared with Arduino IDE 1.x users due to the non-compliant name.
This problem seems less significant in this contrived demo where the sketch name causes compilation failure, but other non-compliant sketch names will not have an obvious impact to the Arduino IDE 2.x user.
⚠ Due to a bug in Arduino Web Editor, the sketch will be impossible to delete and might possibly cause other problems, so I don't recommend actually doing this with any Arduino account you care about.
🐛 There is an error message on import.
🐛 The sketch is impossible to delete:
🐛 Arduino IDE 2.x allows the creation of sketches that are either unusable or not portable to other official development software.
Expected behavior
Arduino IDE 2.x does not allow the creation of sketches with non-compliant names.
Sketches created with one development tool are usable in all other tools.
Arduino IDE version
2.0.1
Operating system
Operating system version
Additional context
Originally reported by @UKHeliBob at https://forum.arduino.cc/t/file-save-as-allows-invalid-filenames-to-be-used/700966
Related:
Issue checklist
The text was updated successfully, but these errors were encountered: