cedar-policy / cedar

Implementation of the Cedar Policy Language

Home Page:https://www.cedarpolicy.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The formatter doesn't split policy scope into multiple lines when there are `is` operations

shaobo-he-aws opened this issue · comments

Before opening, please confirm:

Bug Category

Other

Describe the bug

Consider this policy from TinyTodo,

permit (principal, action, resource is List)
when { resource.owner == principal };

The formatter doesn't do anything with it, which should format it into,

permit (
  principal,
  action,
  resource is List
)
when { resource.owner == principal };

Expected behavior

See above.

Reproduction steps

cargo run format <<< 'permit (principal, action, resource is List)
when { resource.owner == principal };'

Code Snippet

// Put your code below this line.

Log output

// Put your output below this line

Additional configuration

No response

Operating System

No response

Additional information and screenshots

No response