Skip to content

Allow the ability to format a DSL file #485

Description

@rhamzeh

We would like to expose a new method: formatter.Format(dslFile, options).

Given a DSL file contents, it would return a formatted DSL file.

Options may not be much at the start, but can grow to include:

  • using spaces instead of tabs
  • tab width
  • having a space between types
  • grouping assignable relations at the top
  • grouping non-assignable relations prefixed with is_ or can_ at the bottom

For modular models, we should allow passing a map containing the fga.mod and the contents of each file, but that should be a separate ticket.

In later tickets:

  • this should be integrated into the VS Code ext, IntelliJ plugin and CLI
  • We should allow formatting the store file

Also potentially later combined with a linter used in a github action

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    No fields configured for Enhancement.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions