processing / processing/processing4
Error Dialog for Invalid Filenames is Incomplete
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Java
- Star
- 494
- Fork
- 183
- Merge trung bình
- 4 giờ 39 phút
- Pull request đã merge (30 ngày)
- 3
Mô tả
In GitLab by @chipbuster on Jul 24, 2023, 18:46
Description
When an invalid sketch name is detected, the resulting error dialog does not include all requirements for filenames. This can result in a filename which appears to follow all the rules being rejected.
Possibly related to #741, but skimming that issue, it looked like that was intended to be about compiler errors, while this is more related to IDE errors.
Expected Behavior
If the filename does not follow all the rules, the error dialog should specify what to change.
Current Behavior
The error dialog says:
<filename>is not a valid name for sketch code.
Better to stick to ASCII, no spaces, and make sure
it doesn't start with a number.
However, this does not address the following cases:
- When a non-alphanumeric ASCII character is included in the filename.
- When the stem of the filename is longer than 63 characters.
Steps to Reproduce
Create a file named hello-world.pde or a file whose name consists of the letter 'a' 64 times followed by .pde.
Your Environment
- Processing version: 4.2
- Operating System and OS version: Arch Linux
- Other information: I am (mostly) not manually creating filenames which violate these rules. Rather, it's happening because my learning management system (Canvas) likes to rename files on its own whim, and it tends to add these sorts of things.
Possible Causes / Solutions
One solution would be to explicitly name all the requirements for a filename, e.g. the message reads something like
<filename> is not a valid name for a sketch. Your files must:
1. Use only ASCII letters and numbers.
2. Start with a letter.
3. Be shorter than 63 characters.
but this is not complete either (e.g. right now you are allowed to have underscores in the name).
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu trong app/src/processing/app/Sketch.java, xung quanh các bước kiểm tra tên tệp ở dòng 1870 và 1886, sau đó lần theo nơi nội dung hộp thoại cho tên không hợp lệ được ghép lại. So sánh hộp thoại với các quy tắc xác thực, bao gồm các ký tự không phải chữ và số, độ dài tối đa của phần gốc tên và các dấu gạch dưới được phép. Công việc được xem là hoàn tất khi hộp thoại giải thích mọi quy tắc có thể khiến tên tệp bị từ chối.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- desktop
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 42/100