Re: [BuildStream] Proposal: bst fmt command



Hey,

I like this idea, just a few comments inline

On Tue, Nov 13, 2018 at 2:40 PM Javier Jardón <jjardon gnome org> wrote:
On Tue, 13 Nov 2018 at 13:11, Thomas Coldrick via BuildStream-list
<buildstream-list gnome org> wrote:
>
> Hi all,
>
> There's been an issue[0] open for a while to implement a `bst fmt`
> command to format elements into a canonical format, opened after it was
> found `bst track` modifies yaml indentation[1]. As the yaml modification
> is due to ruamel, it would be nice to use the behaviour of this bug as a
> feature.
>
> I propose implementing the following functionalities:
> * Running `bst fmt <element>`formats just the element passed to the
> command

+1

> * Running `bst fmt --all` formats all elements in the project

I would like to synchronize with the `bst build` and `bst show` command, which have MRs in flight for the same thing (!925 and !926) to make sure we use the same terminology (we have --all and --world currently). It would be good to have a consistent CLI for between them.
 
+1

> * Running `bst fmt --check <element>` doesn't modify any files, but
> fails if not formatted correctly, and produces a diff of where
> formatting must be done

+1, maybe we could use "bst validate/verify" for this instead, but I'm
ok with the --check options as well
I guess this would support bst fmt --all --check ?

> * Users can define the order of top-level nodes in an element, running
> `bst fmt` on an element rearranges the nodes into this order
>    - This may vary between projects, but a canonical format for each
> project would be a useful feature

Indeed, this would be a great feature!

> * We could also include a `--except` option, as in `bst track`
>
> This is only a minor feature, but will mitigate the pain of ruamel's
> changing of indentation.

Thanks a lot to work on this; it would indeed very helpful to have a
uniform format in our builstream projects

Cheers,
Javier

Cheers,
Ben
_______________________________________________
BuildStream-list mailing list
BuildStream-list gnome org
https://mail.gnome.org/mailman/listinfo/buildstream-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]