Description
Currently, multi-dot separated variables in R is not allowed. For example,
setMethod("from_json", signature(x = "Column", schema = "structType"), - function(x, schema, asJsonArray = FALSE, ...) { + function(x, schema, as.json.array = FALSE, ...) { if (asJsonArray) { jschema <- callJStatic("org.apache.spark.sql.types.DataTypes", "createArrayType",
produces an error as below:
R/functions.R:2462:31: style: Words within variable and function names should be separated by '_' rather than '.'. function(x, schema, as.json.array = FALSE, ...) { ^~~~~~~~~~~~~
This seems against https://google.github.io/styleguide/Rguide.xml#identifiers which says
The preferred form for variable names is all lower case letters and words separated with dots
This looks because lintr https://github.com/jimhester/lintr follows http://r-pkgs.had.co.nz/style.html as written in the README.md. Few cases seems not following Google's one.
Per SPARK-6813, we follow Google's R Style Guide with few exceptions https://google.github.io/styleguide/Rguide.xml. This is also merged into Spark's website - https://github.com/apache/spark-website/pull/43
Also, we have no limit on function name. This rule also looks affecting to the name of functions as written in the README.md.
multiple_dots_linter: check that function and variable names are separated by _ rather than ..