Skip to content

Instantly share code, notes, and snippets.

View yu-iskw's full-sized avatar

Yu Ishikawa yu-iskw

View GitHub Profile
@yu-iskw
yu-iskw / gist:8c47acf3202796da4d01
Last active August 29, 2015 14:25
[SPARK-9093] The result of lintr at 011551620faa87107a787530f074af3d9be7e695
inst/tests/test_binary_function.R:43:6: style: Put spaces around all infix operators.
rdd<- map(text.rdd, function(x) {x})
~^
inst/tests/test_rdd.R:253:59: style: Place a space before left parenthesis, except in a function call.
actual <- collect(flatMapValues(intRdd, function(x) { x:(x + 1) }))
^
inst/tests/test_rdd.R:296:26: style: Put spaces around all infix operators.
func <- function(x) { x*x }
~^~
inst/tests/test_rdd.R:314:21: style: Put spaces around all infix operators.
@yu-iskw
yu-iskw / gist:e7246041b173a3f29482
Last active August 29, 2015 14:25
[SPARK-9052] the result of lint-r at the revision:011551620faa87107a787530f074af3d9be7e695
inst/tests/test_binary_function.R:43:6: style: Put spaces around all infix operators.
rdd<- map(text.rdd, function(x) {x})
~^
inst/tests/test_rdd.R:253:59: style: Place a space before left parenthesis, except in a function call.
actual <- collect(flatMapValues(intRdd, function(x) { x:(x + 1) }))
^
inst/tests/test_rdd.R:296:26: style: Put spaces around all infix operators.
func <- function(x) { x*x }
~^~
inst/tests/test_rdd.R:314:21: style: Put spaces around all infix operators.
@yu-iskw
yu-iskw / gist:be8398c17dc48f82c293
Last active August 29, 2015 14:25
Checking about the infix operator linter as function paramters.

Conclusion

lintr can't catch the warnings about infix operaters in function paramters. So, we should add the linter about the optional paramters.

Experiment

Test File

I created a file which include the code as follows as R/pkg/inst/tests/dummy_file.R. I had expected that a couple of warnings at dummy(x=x, y=y) were catched.

@yu-iskw
yu-iskw / gist:6f57016322b8f7017b82
Last active August 29, 2015 14:25
The result of lint-r for SPARK-9121 at the revision:1ddd0f2f1688560f88470e312b72af04364e2d49
inst/tests/test_binary_function.R:43:6: style: Put spaces around all infix operators.
  rdd<- map(text.rdd, function(x) {x})
    ~^
inst/tests/test_rdd.R:253:59: style: Place a space before left parenthesis, except in a function call.
  actual <- collect(flatMapValues(intRdd, function(x) { x:(x + 1) }))
                                                          ^
inst/tests/test_rdd.R:296:26: style: Put spaces around all infix operators.
  func <- function(x) { x*x }
                        ~^~
@yu-iskw
yu-iskw / lint-r-result.md
Last active August 29, 2015 14:25
The result of lint-r for SPARK-9121 at the revision:1ddd0f2f1688560f88470e312b72af04364e2d49 when I have sent a PR
inst/tests/test_binary_function.R:43:6: style: Put spaces around all infix operators.
  rdd<- map(text.rdd, function(x) {x})
    ~^
inst/tests/test_rdd.R:253:59: style: Place a space before left parenthesis, except in a function call.
  actual <- collect(flatMapValues(intRdd, function(x) { x:(x + 1) }))
                                                          ^
inst/tests/test_rdd.R:296:26: style: Put spaces around all infix operators.
  func <- function(x) { x*x }
                        ~^~
@yu-iskw
yu-iskw / lint-r-result.md
Last active August 29, 2015 14:25
The result of lint-r at the rivision:a4c83cb1e4b066cd60264b6572fd3e51d160d26a
inst/tests/test_sparkSQL.R:115:3: style: Closing curly-braces should always be on their own line, unless it's followed by an else.
  }, error = function(err) {
  ^
inst/tests/test_sparkSQL.R:130:1: style: lines should not be more than 100 characters.
  localDF <- data.frame(name=c("John", "Smith", "Sarah"), age=c(19, 23, 18), height=c(164.10, 181.4, 173.7))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
inst/tests/test_sparkSQL.R:605:3: style: Closing curly-braces should always be on their own line, unless it's followed by an else.
  }, error = function(err) {
  ^
@yu-iskw
yu-iskw / lint-r-result.md
Created July 22, 2015 06:32
The result of lint-r at the revision:c03299a18b4e076cabb4b7833a1e7632c5c0dabe
inst/tests/test_sparkSQL.R:115:3: style: Closing curly-braces should always be on their own line, unless it's followed by an else.
  }, error = function(err) {
  ^
inst/tests/test_sparkSQL.R:130:1: style: lines should not be more than 100 characters.
  localDF <- data.frame(name=c("John", "Smith", "Sarah"), age=c(19, 23, 18), height=c(164.10, 181.4, 173.7))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
inst/tests/test_sparkSQL.R:605:3: style: Closing curly-braces should always be on their own line, unless it's followed by an else.
  }, error = function(err) {
  ^
@yu-iskw
yu-iskw / lint-r-result.md
Created July 24, 2015 05:35
The result of lintr for SPARK-9249 at the revision:d249636e59fabd8ca57a47dc2cbad9c4a4e7a750

[SPARK-9249] local variable assigned but may not be used - ASF JIRA

inst/tests/test_binary_function.R:43:6: style: Put spaces around all infix operators.
  rdd<- map(text.rdd, function(x) {x})
    ~^
inst/tests/test_rdd.R:253:59: style: Place a space before left parenthesis, except in a function call.
  actual <- collect(flatMapValues(intRdd, function(x) { x:(x + 1) }))
                                                          ^
inst/tests/test_rdd.R:296:26: style: Put spaces around all infix operators.
@yu-iskw
yu-iskw / lint-r-result.md
Created July 30, 2015 11:53
The result of `dev/lint-r` for SPARK-9248 at the revistion:6175d6cfe795fbd88e3ee713fac375038a3993a8
inst/tests/test_binary_function.R:43:6: style: Put spaces around all infix operators.
  rdd<- map(text.rdd, function(x) {x})
    ~^
inst/tests/test_rdd.R:253:59: style: Place a space before left parenthesis, except in a function call.
  actual <- collect(flatMapValues(intRdd, function(x) { x:(x + 1) }))
                                                          ^
inst/tests/test_rdd.R:296:26: style: Put spaces around all infix operators.
  func <- function(x) { x*x }
                        ~^~
@yu-iskw
yu-iskw / extract.md
Last active August 29, 2015 14:27
Extract the function metadata from `functions.scala`
{
  "def upper(e: Column): Column": {
    "R": false,
    "params": [
      "Column"
    ],
    "return_type": "Column",
    "name": "upper"
  },