Skip to content

Automatically convert non-compliant sketch names when saving #2866

Description

@Greggles182

Describe the request

When saving, automatically replace any spaces in the selected filename with dashes or underscores.

Describe the current behavior

There are specific restrictions on sketch names:

https://arduino.github.io/arduino-cli/dev/sketch-specification/#sketch-folders-and-files

If the user specifies a non-compliant name in the "Save As..." dialog (e.g., foo bar), Arduino IDE displays a dialog:

Image

Invalid sketch folder name: 'foo bar'

The name must start with a letter, number, or underscore, followed by letters, numbers, dashes, dots and underscores. Maximum length is 63 characters.

Do you want to try saving the sketch with a different name?

The user then tries saving a again with a compliant name.

Arduino IDE version

  • 2.3.7
  • nightly

Operating system

Windows

Operating system version

11

Additional context

Arduino IDE 1.x has the requested behavior.

Additional requests

Keywords

  • "invalid"

  • "normalize"

  • "normalized

  • "sanitize"

  • "sanitized"

  • "specification compliant"

  • "specification-compliant"

  • "valid"

Issue checklist

  • I searched for previous requests in the issue tracker
  • I verified the feature was still missing when using the latest nightly build
  • My request contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: enhancementProposed improvement

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions