buildtools icon indicating copy to clipboard operation
buildtools copied to clipboard

integer-division buildifier warning triggers on floating point division

Open gholms opened this issue 3 years ago • 0 comments

The buildifier warning for integer division seems to trigger when it finds any binary expression that uses the / operator, regardless of its operands' types. Ideally, it shouldn't do that when one of the operands is known to be a float, such as a floating point literal or something wrapped with a call to float.

A great reproducer for this is to run buildifier linting on a file containing the expression x = 1.0 / 1.0.

gholms avatar Jan 08 '22 00:01 gholms