Request for yamlfmt classic confinment

Hi,

We would like to make yamlfmt 1.1 have a classic confinement

yamlfmt is a simple yaml formatter, which reads a files and formats it.

For example:

"groups": 
- "name": "etcd"
  "rules": 
  - "alert": "EtcdInsufficientMembers"
    "annotations": 
      "message": "Etcd cluster \"{{ $labels.job }}\": insufficient members ({{ $value }})."
    "expr": |
      count(up{job="etcd"} == 0) by (job) > (count(up{job="etcd"}) by (job) / 2 - 1)
    "for": "3m"
    "labels": 
      "severity": "critical"

After executing yamlfmt it becomes:

groups:
- name: etcd
  rules:
  - alert: EtcdInsufficientMembers
    annotations:
      message: 'Etcd cluster "{{ $labels.job }}": insufficient members ({{ $value
        }}).'
    expr: |
      count(up{job="etcd"} == 0) by (job) > (count(up{job="etcd"}) by (job) / 2 - 1)
    for: 3m
    labels:
      severity: critical

Source code is available in: https://github.com/devopyio/yamlfmt

Previously we had plugs: ["home", "desktop"], but that is not enough if a file is outside the home or desktop directory.

Is there any way we can achieve this without classic confinement?

Here is the link to failed review https://dashboard.snapcraft.io/snaps/yamlfmt/revisions/17/

Thank you for taking a look!


Best Regards
Jonas

I’d prefer if this sort of tool used home and removable-media (I don’t see why it would need desktop); if the file you’re wanting to format is not in home (or removable-media) it’s not unreasonable to tell the user to do the file replacing themselves.

Is it really that common to want to format a file not in your home?

Keep in mind that making it classic would mean that you can’t use the snap on a core device.

1 Like

Thanks for the info. I needed that for removable-media stuff, didn’t know that plug exists. Thanks!

You can close this.

2 Likes