processing / processing/processing4

Error Dialog for Invalid Filenames is Incomplete

Aperta
#754 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Java
Stelle
494
Fork
183
Merge medio
4h 39m
PR unite (30g)
3

Descrizione

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:

  1. When a non-alphanumeric ASCII character is included in the filename.
  2. 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).

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia in app/src/processing/app/Sketch.java, intorno ai controlli del nome file alle righe 1870 e 1886, quindi segui il punto in cui viene assemblato il testo della finestra di dialogo per i nomi non validi. Confronta la finestra di dialogo con le regole di validazione, inclusi i caratteri non alfanumerici, la lunghezza massima della radice del nome e gli underscore consentiti. Il lavoro è completato quando la finestra di dialogo spiega ogni regola che può rifiutare il nome file.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
desktop
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.