Reformat code does not handle tidyeval `{{ }}` operator correctly

Here is my customized function.

calc_x <- function(df, word, beta) {
    df %>%
        mutate(sql_text = map2_chr(
            {{word}}, {{beta}},
            ~ paste(word, beta)
        ))
}

When I use the reformat code feature, the functon is reformatted in this way.

calc_x <- function(df, word, beta) {
    df %>%
        mutate(sql_text = map2_chr({
            {
                word
            }
        }, {
            {
                beta
            }
        },
        ~ paste(word, beta)))
}

How to maintain the {{}} unchanged?

You might want to file this as a bug report / feature request here.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.