Skip to content
New issue

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

False-positive object_name_linter for %<-% #495

Closed
bersbersbers opened this issue May 20, 2020 · 7 comments · Fixed by #698
Closed

False-positive object_name_linter for %<-% #495

bersbersbers opened this issue May 20, 2020 · 7 comments · Fixed by #698
Labels
bug an unexpected problem or unintended behavior

Comments

@bersbersbers
Copy link

This line

`%<-%` <- zeallot::`%<-%`

raises

Variable and function name style should be snake_case.

@russHyde
Copy link
Collaborator

russHyde commented Dec 9, 2020

@bersbersbers could you check if this is still an issue when using the current master. The object-name linter used by the default_linters has been modified to allow symbol-names.

@russHyde
Copy link
Collaborator

russHyde commented Dec 9, 2020

Cross-ref #677

@russHyde russHyde added the bug an unexpected problem or unintended behavior label Dec 9, 2020
@bersbersbers
Copy link
Author

bersbersbers commented Dec 9, 2020

Does not work:

> Rscript -e 'devtools::install_github("https://github.com/jimhester/lintr", force=T)'
Downloading GitHub repo jimhester/lintr@HEAD

✔  checking for file ‘/tmp/Rtmpuvgv6n/remotes56b02395a43a/jimhester-lintr-e759d2a/DESCRIPTION’ ...
─  preparing ‘lintr’:
✔  checking DESCRIPTION meta-information ...
─  installing the package to process help pages
─  checking for LF line-endings in source and make files and shell scripts (3.5s)
─  checking for empty or unneeded directories
─  building ‘lintr_2.0.1.9000.tar.gz’
   Warning: invalid uid value replaced by that for user 'nobody'
   
* installing *source* package ‘lintr’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (lintr)
> echo "\`%<-%\` <- zeallot::\`%<-%\`" > bug.R
> Rscript -e 'lintr::lint("bug.R")'
/home/bers/bug.R:1:1: style: Variable and function name style should be snake_case or symbols.
`%<-%` <- zeallot::`%<-%`

@AshesITR
Copy link
Collaborator

AshesITR commented Dec 9, 2020

Thanks for trying. This should conform to the new symbols style, so that regex needs fixing 😄

AshesITR added a commit that referenced this issue Dec 9, 2020
fixes #495

the major issue was that `as.character()` doesn't unescape XML entities. `xml2::xml_text()` should have been used instead.
@bersbersbers
Copy link
Author

Works after

Rscript -e 'devtools::install_github("https://github.com/jimhester/lintr/pull/698")'

@MichaelChirico
Copy link
Collaborator

Great! Closing

@MichaelChirico
Copy link
Collaborator

Oh. I can't read.

AshesITR added a commit that referenced this issue Dec 11, 2020
fixes #495

the major issue was that `as.character()` doesn't unescape XML entities. `xml2::xml_text()` should have been used instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants