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

Lint framework #1

Closed
jimhester opened this issue Oct 14, 2014 · 2 comments
Closed

Lint framework #1

jimhester opened this issue Oct 14, 2014 · 2 comments

Comments

@daroczig
Copy link

daroczig commented Nov 1, 2014

parser was built in core R from version 3.0.0 and it has really great features that I use e.g. in my sandboxR package, which also has to check bunch of stuff about user provided R code. Quick demo:

> getParseData(parse(text = 'library(RColorBrewer)'))
  line1 col1 line2 col2 id parent                token terminal         text
9     1    1     1   21  9      0                 expr    FALSE             
1     1    1     1    7  1      3 SYMBOL_FUNCTION_CALL     TRUE      library
3     1    1     1    7  3      9                 expr    FALSE             
2     1    8     1    8  2      9                  '('     TRUE            (
4     1    9     1   20  4      6               SYMBOL     TRUE RColorBrewer
6     1    9     1   20  6      9                 expr    FALSE             
5     1   21     1   21  5      9                  ')'     TRUE            )

@jimhester
Copy link
Member Author

Yep I am using the built in parser functions extensively in lintr, this
issue was just a place for me to keep links to pre-existing linting tools
On Nov 1, 2014 5:25 PM, "Gergely Daróczi" notifications@github.com wrote:

parser was built in core R from version 3.0.0 and it has really great
features that I use e.g. in my sandboxR package
https://github.com/Rapporter/sandboxR/tree/r-3.0.0, which also has to
check bunch of stuff about user provided R code. Quick demo:

getParseData(parse(text = 'library(RColorBrewer)'))
line1 col1 line2 col2 id parent token terminal text9 1 1 1 21 9 0 expr FALSE 1 1 1 1 7 1 3 SYMBOL_FUNCTION_CALL TRUE library3 1 1 1 7 3 9 expr FALSE 2 1 8 1 8 2 9 '(' TRUE (4 1 9 1 20 4 6 SYMBOL TRUE RColorBrewer6 1 9 1 20 6 9 expr FALSE 5 1 21 1 21 5 9 ')' TRUE )


Reply to this email directly or view it on GitHub
#1 (comment).

MichaelChirico added a commit that referenced this issue May 21, 2024
* Update scalar_in_linter.R (#1)

Make scalar_in_linter configurable to allow projects to define additional %in% style functions like %notin%.

* Incorporate review feedback (#2)

* Incorporate review feedback

- Use glue in xpath,
- Add changes to NEWS
- Change default for scalar_in_linter
- Make lint msg more open ended if another %in% operator was linted
- Update tests to match new bahaviour

* Add a vector of in operators (#3)

* Add a testcase based on configuration (#4)

* Improve lint message, NEWS, param documentation (#5)

* Improve lint message (#6)

* Update R/scalar_in_linter.R

Co-authored-by: Michael Chirico <michaelchirico4@gmail.com>

* Update lint message (#7)

---------

Co-authored-by: Michael Chirico <michaelchirico4@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants