Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve formatting of a sequence of identifiers #1342

Open
1 of 2 tasks
shaobo-he-aws opened this issue Nov 27, 2024 · 0 comments
Open
1 of 2 tasks

Improve formatting of a sequence of identifiers #1342

shaobo-he-aws opened this issue Nov 27, 2024 · 0 comments
Assignees
Labels
internal-improvement Refactoring, minor performance improvement, or other changes that Cedar users may never notice papercut Small annoyances in the Cedar SDK. Lower priority fixes than bugs. Smaller than a fature request

Comments

@shaobo-he-aws
Copy link
Contributor

Describe the improvement you'd like to request

The formatter currently does a horrible job in formatting a sequence of identifiers. For instance,

// An example from RFC
permit(
  principal is User,
  action == Action::"preview",
  resource == Movie::"Blockbuster"
) when {
    // extended has
  principal has 
  // contactInfo
  contactInfo.
  // address
  address.
  // zip
  zip &&
  // we are safe to access all attributes
  principal.contactInfo.address.zip == "90210"
};

is formatted into,

// An example from RFC
permit (
  principal is User,
  action == Action::"preview",
  resource == Movie::"Blockbuster"
)
when
{
  // extended has
  principal
  has
    // contactInfo
    contactInfo.
      // address
      address
      .
      // zip
      zip &&
  // we are safe to access all attributes
  principal.contactInfo
    .address
    .zip == "90210"
};

Describe alternatives you've considered

No response

Additional context

No response

Is this something that you'd be interested in working on?

  • 👋 I may be able to implement this internal improvement
  • ⚠️ This feature might incur a breaking change
@shaobo-he-aws shaobo-he-aws added pending-triage The cedar maintainers haven't looked at this yet. Automicaly added to all new issues. internal-improvement Refactoring, minor performance improvement, or other changes that Cedar users may never notice labels Nov 27, 2024
@shaobo-he-aws shaobo-he-aws changed the title Formatting a sequence of identifiers Improve formatting of a sequence of identifiers Nov 27, 2024
@shaobo-he-aws shaobo-he-aws self-assigned this Nov 27, 2024
@shaobo-he-aws shaobo-he-aws added papercut Small annoyances in the Cedar SDK. Lower priority fixes than bugs. Smaller than a fature request and removed pending-triage The cedar maintainers haven't looked at this yet. Automicaly added to all new issues. labels Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal-improvement Refactoring, minor performance improvement, or other changes that Cedar users may never notice papercut Small annoyances in the Cedar SDK. Lower priority fixes than bugs. Smaller than a fature request
Projects
None yet
Development

No branches or pull requests

1 participant