Suspicious Indent vs clean code

已回答
// part of floyd-steinberg dithering
double quantError = (oldPixel - newPixel) / 16.0;
if(b2+1 <  steps) error0[b2+1] += quantError * 7.0;
if(b2-1 >= 0    ) error1[b2-1] += quantError * 3.0;
                  error1[b2  ] += quantError * 5.0;
if(b2+1 <  steps) error1[b2+1] += quantError * 1.0;

Long have I wished for a way to organize code into tables so that I could maintain this kind of well-aligned formatting without being flagged / reformated / etc.  To me this is much cleaner by making it more human readable, highlighting the similarities and differences. 

I don't have a reasonable change for the third line “suspicious indent” warning.  I don't see other coders doing this kind of indenting.  I guess I just wanted to express my wish and put it out in the universe.

0

Hello,

Coud you please clarify a bit? Do you need to suppress “suspicious indent” warning?

0

Need is too strong a word.  I recognize the warning is technically correct.  

The system does not recognize that I have applied a special formatting to make these lines more human-readable.

0

Dan,

Thanks for clarification! Feel free to create feature request on YouTrack: https://youtrack.jetbrains.com/issues/IJPL

0

tab space tab tab is suspicious.

tab tab tab is not suspicious.

Maybe my definition of suspicious is wrong.  What makes this “suspicious”?  It's harmless.

0

Dan Royer 

Your definition of suspicious is not wrong:

The inspection gets confused by mixed usage of tabs and spaces. The issue was reported a long time ago, but only one person upvoted it since then, hence the shelved state: IDEABKL-5095 

0

请先登录再写评论。