Skip to content

Windows ms-dos file support 'Batch File' #1943

@benzaria

Description

@benzaria

Request for Windows Batch File Support

It would be fantastic to have support for automatically formatting batch files. Currently, formatting these files is only possible manually, which can be tedious and error-prone.

Batch files are often overlooked, and their formatting tends to be inconsistent. While batch is not a rich scripting language, its simplicity means that adding support shouldn't require extensive work. The key elements to consider include:

  • Conditional Statements: if, else
  • Loops: for
  • Labels as Functions: e.g., :label
  • Built-in Keywords: Common commands like echo, set, etc.

Additionally, please ensure the formatter gracefully handles raw bits, as these are frequently used in batch files. For example, many users rely on ESC sequences for special purposes.

I also recommend not implementing a snippets checker, as many batch users rely on non-operational constructs (no-ops) for creative and often obscure tasks. A common example is embedding JavaScript within batch files. Adding a strict checker might interfere with such patterns.
And DO NOT make spaces between Redirection operation < >: this 0</* :: is not 0 < /* ::.

To summarize, a formatter alone—without enforcing syntax validation—would greatly benefit the batch file community and enhance productivity.

Thank you for considering this feature!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions