From 715f005986a2015b5c0ddd1bde5c726207b12500 Mon Sep 17 00:00:00 2001 From: nathaneastwood Date: Wed, 7 Mar 2018 11:08:03 +0000 Subject: [PATCH] fix: Allow for (( when linting. Fixes #259 --- NEWS.md | 1 + R/spaces_left_parentheses_linter.R | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 88685b41d..113db9caa 100644 --- a/NEWS.md +++ b/NEWS.md @@ -85,6 +85,7 @@ * Permit single quotes if they quote literal double quotes (#28, @jackwasey) * # nolint comments are respected with caching (#68, @krlmlr) * Properly handle all knitr document formats +* Allow for (( when linting (#259, @nathaneastwood) # lintr 0.2.0 # diff --git a/R/spaces_left_parentheses_linter.R b/R/spaces_left_parentheses_linter.R index d91eb2aa6..b19b430f5 100644 --- a/R/spaces_left_parentheses_linter.R +++ b/R/spaces_left_parentheses_linter.R @@ -24,7 +24,7 @@ spaces_left_parentheses_linter <- function(source_file) { before_operator <- substr(line, parsed$col1 - 1L, parsed$col1 - 1L) non_space_before <- re_matches(before_operator, rex(non_space)) - not_exception <- !(before_operator %in% c("!", ":", "[")) + not_exception <- !(before_operator %in% c("!", ":", "[", "(")) if (non_space_before && not_exception) { Lint(