Skip to content

rplumber support #305

Closed
Closed

Description

@lorenzwalthert

styler breaks rplumber syntax by inserting a space between # and *. E.g. take the following example from www.rplumber.io.

# myfile.R

#* @get /mean
normalMean <- function(samples=10){
  data <- rnorm(samples)
  mean(data)
}

#* @post /sum
addTwo <- function(a, b){
  as.numeric(a) + as.numeric(b)
}

This won't work anymore with # * @get etc.

It seems as all plumber tags are listed here. The list includes

  • @get
  • @post
  • @put
  • @delete
  • @head

I think we simply may adapt the regex pattern in https://github.com/r-lib/styler/blob/master/R/rules-spacing.R#L189 to not only support #', but also #*. I don't see any conflicts since roxygen markdown syntax uses #' * bullet (so it won't match).

cc: @trestletech

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions