styler icon indicating copy to clipboard operation
styler copied to clipboard

Workarounds for R bugs that can be dropped

Open lorenzwalthert opened this issue 5 years ago • 3 comments

The tidyverse supports four previous versions of R, so we'll drop some workarounds for some R bugs at some stage:

  • [x] The workaround in parse_transform_serialize_r() introduced with 5523a8f1b20c8b26d06dc187d5556cf2abdd1c67 in getRversion() < 3.4 was not required in R 3.4 anymore.
  • [x] The extra parsing in get_parse_data() introduced in #216 is fixed since R 3.5.2 (bug 16041, https://cran.r-project.org/doc/manuals/r-release/NEWS.html), we don't need another extra round of parsing after this version.
  • [x] The transformer subsetting introduced in 9c4fc1eda8bcc0e56f88537e21cd93dafa35919f with if (getRversion() >= 3.6) for force_assignment_op() is not needed with R 3.6 anymore.
  • [ ] Fixing parse data for 0x not needed in R 4.1 anymore.

*checked: already removed in the default branch

lorenzwalthert avatar Jan 22 '20 12:01 lorenzwalthert

Is it sufficient to search the code for getRversion() to find all workarounds?

krlmlr avatar Apr 06 '21 02:04 krlmlr

Not sure because we also at some point introduced the notion of a parser version, see parser_version_find(), which was probably a mistake. We could add a "unit test" using https://github.com/r-hub/rversions to determine the last four supported versions and make sure there are no workarounds for package versions smaller than this set.

lorenzwalthert avatar Apr 06 '21 07:04 lorenzwalthert

The workaround in parse_transform_serialize_r() introduced with https://github.com/r-lib/styler/commit/5523a8f1b20c8b26d06dc187d5556cf2abdd1c67 in getRversion() < 3.4 was not required in R 3.4 anymore.

I think this has been already removed, since there is no more getRversion() < 3.4 in this file.

IndrajeetPatil avatar Aug 23 '22 10:08 IndrajeetPatil