Skip to content

brace_linter() could allow skipping braces in function factories #1807

@AshesITR

Description

@AshesITR
lintr::lint(text = "function() function(x) {\n  x\n}")
#> <text>:1:1: style: [brace_linter] Any function spanning multiple lines should use curly braces.
#> function() function(x) {
#> ^~~~~~~~~~~~~~~~~~~~~~~~

Created on 2022-12-07 with reprex v2.0.2

This could optionally be allowed in addition to

# always allowed
function() {
  function(x) {
    x
  }
}

# could optionally be allowed
function() function(x) {
  x
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions