Matt Groth
04/27/2023, 2:27 AMcreateReport {
+ "Some text"
+ "Some more text"
"More text" // this will not be included because the unary plus operator was accidentally left out
}
Note this code compiles without errors or warnings and there is no IDE warning. Yet, there is a bug because “More text” was not properly included.
Is there any rule that can detect things like this, where the unary plus operator is accidentally forgotten?Atul Gupta
05/09/2023, 9:00 PMMatt Groth
05/10/2023, 1:22 AMAtul Gupta
05/10/2023, 9:50 AMdetekt
checks covers code smell, potential bugs etc etc. But you can create an issue in ktlint
as wellMatt Groth
05/10/2023, 2:19 PMAtul Gupta
05/10/2023, 2:21 PMAtul Gupta
05/10/2023, 2:21 PMMatt Groth
05/10/2023, 2:21 PM