Hi,

I would like to propose a universal coding style using clang-format [0].
I've put together the config file that is matching the current coding style
as closely as possible [1]. I've tried it on some random pieces of code
that we have in the OVN codebase and there are some instances where it
doesn't much 1:1 (down below). The idea would be to add this into CI and
run this only on diff so we don't have to modify old code. Let me know what
you think and if it would be acceptable. In the end we can have a style and
let some pieces of code diverge on that.

Before:
ctl_error(ctx, "Same routing policy already existed on the "
          "logical router %s.", ctx->argv[1]);

After:

ctl_error(ctx,
          "Same routing policy already existed on the logical "
          "router %s.",
          ctx->argv[1]);

Before:
return (out_port != VIGP_CONTROL_PATH
        ? alpheus_output_port(dp, skb, out_port)
        : alpheus_output_control(dp, skb, fwd_save_skb(skb),
                                 VIGR_ACTION));

After:
return (
    out_port != VIGP_CONTROL_PATH
        ? alpheus_output_port(dp, skb, out_port)
        : alpheus_output_control(dp, skb, fwd_save_skb(skb), VIGR_ACTION));



Thanks,
Ales


[0] https://gist.github.com/almusil/d9fc05c9e9ab6cef9448e123b49c351e
[1] https://docs.ovn.org/en/stable/internals/contributing/coding-style.html

-- 

Ales Musil

Senior Software Engineer - OVN Core

Red Hat EMEA <https://www.redhat.com>

amu...@redhat.com
<https://red.ht/sig>
_______________________________________________
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to