2013-12-16 46 views
10

随着Artistic Style代码格式化,我该如何实现--break-after-logical/-xL这样的,如果我有...如何与“艺术风格”

if (thisVariable1 == thatVariable1 
     || thisVariable2 == thatVariable2 
     || thisVariable3 == thatVariable3) 
    ... 

...我得到相反“别让” C代码..

if (thisVariable1 == thatVariable1 || thisVariable2 == thatVariable2 || thisVariable3 == thatVariable3) 
    ... 
+12

@CloseVoter:如果一个代码美化不属于“主要用于编程的工具”一类的话,我不知道什么可能会。 –

+0

从阅读文档:可能是'--unpad-paren/-U'? – usr2564301

+0

@Jongware只是试了一下,它没有工作(虽然好主意)。 – puk

回答

5

Artistic style似乎没有使这成为可能。

这是相当合理的,因为它实际上混淆的代码:

  • 垂直对齐通过强调相同图案提高易读性,和不同模式以及(单一!=将更难察觉在一维衬垫)。
  • 它也简化了差异跟踪。

我真的写:

if ( thisVariable1 == thatVariable1 
    || thisVariable2 == thatVariable2 
    || longerVariable3 == thatVariable3) 
    ...