lint/test/linters/jscpd/good/r_good_1.r
Marco Ferrari 11b70102c3
feat!: run linters against the workspace (#5041)
- Run jscpd, gitleaks, textlint  against the entire workspace instead of
  running them over single files, one by one.
- Implement a warning function for deprecated variables.
- Deprecate the VALIDATE_JSCPD_ALL_CODEBASE variable.
- Remove duplicate configuration files when they are the same as the
  ones we provide in TEMPLATES.
- Add a missing tests for ansible-lint.
- Move ANSIBLE_DIRECTORY configuration when running tests in
  buildFileList, where similar configs are.
- Simplify ansible-lint test cases to include only what's necessary, and
  not an entire set of roles, playbooks, and inventory.
- Write instructions about major upgrades in the upgrade guide.
2023-12-24 17:56:15 +01:00

48 lines
691 B
R

# Each of the default linters should throw at least one lint on this file
# assignment
# function_left_parentheses
# closed_curly
# commas
# paren_brace
f <- function(x, y = 1) {
}
# commented_code
# cyclocomp
# equals_na
# infix_spaces
# line_length
# object_length
# object_name
# object_usage
# open_curly
short_snake <- function(x) {
y <- 1
y <- y^2
if (1 > 2 && 5 * 10 > 6 && is.na(x)) {
TRUE
} else {
FALSE
}
}
# pipe_continuation
# seq_linter
# spaces_inside
x <- 1:10
x[2]
seq_len(x) %>%
lapply(function(x) x * 2) %>%
head()
# single_quotes
message("single_quotes")
# spaces_left_parentheses
# trailing_whitespace
y <- 2 + (1:10)
# trailing_blank_lines