numeric_leading_zero_linter {lintr} | R Documentation |
Require usage of a leading zero in all fractional numerics
Description
While .1 and 0.1 mean the same thing, the latter is easier to read due to the small size of the '.' glyph.
Usage
numeric_leading_zero_linter()
Tags
consistency, readability, style
See Also
linters for a complete list of linters available in lintr.
Examples
# will produce lints
lint(
text = "x <- .1",
linters = numeric_leading_zero_linter()
)
lint(
text = "x <- -.1",
linters = numeric_leading_zero_linter()
)
# okay
lint(
text = "x <- 0.1",
linters = numeric_leading_zero_linter()
)
lint(
text = "x <- -0.1",
linters = numeric_leading_zero_linter()
)
[Package lintr version 3.1.2 Index]