processing / processing/processing4

Error Dialog for Invalid Filenames is Incomplete

オープン
#754 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Java
スター
494
フォーク
183
平均マージ
4時間 39分
マージ済み PR(30日)
3

説明

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).

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

app/src/processing/app/Sketch.java の 1870 行目と 1886 行目付近にあるファイル名チェックから始め、次に無効な名前のダイアログテキストがどこで組み立てられているかを追跡します。英数字以外の文字、ステムの最大長、使用可能なアンダースコアなど、検証ルールとダイアログを比較します。ファイル名を拒否する可能性のあるすべてのルールをダイアログが説明していれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
desktop
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。