Skip to content

Leading blank lines in a scope are not removed when a comment present #951

@IndrajeetPatil

Description

@IndrajeetPatil

without comment

styler::style_text(
  'test_that(
  desc = "bla",
  code = {

    expect_equal(1 + 1, 2)
  })'
)
#> test_that(
#>   desc = "bla",
#>   code = {
#>     expect_equal(1 + 1, 2)
#>   }
#> )

with comment

styler::style_text(
  'test_that(
  desc = "bla",
  code = {



    # comment
    expect_equal(1 + 1, 2)
  })'
)
#> test_that(
#>   desc = "bla",
#>   code = {
#> 
#> 
#> 
#>     # comment
#>     expect_equal(1 + 1, 2)
#>   }
#> )

Created on 2022-06-13 by the reprex package (v2.0.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions