[libcamera-devel] [PATCH] clang-format: Enable BreakBeforeTernaryOperators

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Jan 30 13:26:53 CET 2019


Hi Kieran,

Thank you for the patch.

On Wed, Jan 30, 2019 at 11:13:49AM +0000, Kieran Bingham wrote:
> This produces code with the ternary operators at the beginning instead of the
> end of the line:
> 
>        return caps_.isMultiplanar() ? getFormatMultiplane(fmt)
>                                     : getFormatSingleplane(fmt);
> 
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> ---
>  .clang-format | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/.clang-format b/.clang-format
> index 59a61d050e3d..d4669dd93f8d 100644
> --- a/.clang-format
> +++ b/.clang-format
> @@ -47,7 +47,7 @@ BraceWrapping:
>  BreakBeforeBinaryOperators: None
>  BreakBeforeBraces: Custom
>  #BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0
> -BreakBeforeTernaryOperators: false
> +BreakBeforeTernaryOperators: true
>  BreakConstructorInitializersBeforeComma: false
>  #BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
>  BreakAfterJavaFieldAnnotations: false

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list