We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As seen in microsoft/LightGBM#5249
grepl( pattern = "[Ordinal/Name Pointer] Table" , x = objdump_results , fixed = TRUE ) # <text>:2:14: warning: Use file.path() to construct portable file paths. # pattern = "[Ordinal/Name Pointer] Table" # ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
The text was updated successfully, but these errors were encountered:
A more minimal test case example:
lintr::lint( text = "grepl('[a/b] c', x, fixed = TRUE)", linters = lintr::nonportable_path_linter() ) #> <text>:1:8: warning: [nonportable_path_linter] Use file.path() to construct portable file paths. #> grepl('[a/b] c', x, fixed = TRUE) #> ^~~~~~~
Created on 2022-07-16 by the reprex package (v2.0.1)
Sorry, something went wrong.
Root cause of the problem, since this should return FALSE here:
FALSE
lintr:::is_path("[a/b] c") #> [1] TRUE
This regex needs to be modified 🙈
lintr:::path_regex #> (?:(?:(?:^/(?![[:space:]/]))|(?:^~(?:[A-Za-z0-9_\-.])*(?:/)*(?![[:space:]'"]))|(?:^[[:alpha:]]:(?:[/\\])?(?![[:space:]/\\]))|(?:^\\\\(?:(?:[A-Za-z0-9_\-.])+(?:\\)?)?(?![[:space:]\\'"])))|(?:^(?!(?:['"]|(?:(?:^/(?![[:space:]/]))|(?:^~(?:[A-Za-z0-9_\-.])*(?:/)*(?![[:space:]'"]))|(?:^[[:alpha:]]:(?:[/\\])?(?![[:space:]/\\]))|(?:^\\\\(?:(?:[A-Za-z0-9_\-.])+(?:\\)?)?(?![[:space:]\\'"])))|(?:[[:alpha:]])+://)))(?:(?:(?:(?:(?:[[:alnum:]]| #> |[!#$%&'()+,\-.;=@\[\]\^_`{}~]))+(?:/|\\))|(?:\.(?:\.)?$))(?!['"])))
Hi. I've hit a similar false positive using grepl. Is this something I can help out with? I'm relatively new to R but I'm willing to give it a shot.
grepl
No branches or pull requests
As seen in microsoft/LightGBM#5249
The text was updated successfully, but these errors were encountered: