Use this rule to limit the permitted values for floating-point numbers. YAML permits three classes of float expressions: approximation to real numbers, positive and negative infinity and "not a number".
require-numeral-before-decimal to require floats to start
with a numeral (eg. 0.0 instead of .0).forbid-scientific-notation to forbid scientific notation.forbid-nan to forbid NaN (not a number) values.forbid-inf to forbid infinite values.Examples
With float-values: {require-numeral-before-decimal: true}
the following code snippets would PASS:
anemometer:
angle: 0.0
the following code snippets would FAIL:
anemometer:
angle: .0
With float-values: {forbid-scientific-notation: true}
the following code snippets would PASS:
anemometer:
angle: 0.00001
the following code snippets would FAIL:
anemometer:
angle: 10e-6
With float-values: {forbid-nan: true}
the following code snippets would FAIL:
anemometer:
angle: .NaN
With float-values: {forbid-inf: true}
the following code snippets would FAIL:
anemometer:
angle: .inf