Skip to content

expect_lint() improvement - #233

Merged
jimhester merged 14 commits into
masterfrom
expect_from_string
May 12, 2017
Merged

jimhester merged 14 commits into
masterfrom
expect_from_string

Conversation

@fangly

@fangly fangly commented Apr 27, 2017

Copy link
Copy Markdown
Contributor

No description provided.

@codecov-io

codecov-io commented Apr 27, 2017 •

Copy link
Copy Markdown

Codecov Report

Merging #233 into master will increase coverage by 0.26%.
The diff coverage is 92.3%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #233      +/-   ##
==========================================
+ Coverage   85.87%   86.13%   +0.26%     
==========================================
  Files          39       39              
  Lines        2180     2178       -2     
==========================================
+ Hits         1872     1876       +4     
+ Misses        308      302       -6
Impacted Files Coverage Δ
R/lint.R 71.57% <0%> (ø) ⬆️
R/expect_lint.R 84.21% <100%> (+7.93%) ⬆️
R/utils.R 75.25% <0%> (+1.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 656ccfd...366fef4. Read the comment docs.

@jimhester

Copy link
Copy Markdown
Member

I think this is fine, but really we should remove the file handing entirely and modify the tests to lint a text by ending with a newline. e.g.

lintr::lint("a = b\n")
#> <text>:1:3: style: Use <-, not =, for assignment.
#> a = b

@fangly

fangly commented Apr 28, 2017

Copy link
Copy Markdown
Contributor Author

Thanks Jim. I now understand the undocumented piece of code in lint().
I recorded your improvement suggestion at #234; this will be a task for another day.
I'll let you merge this PR.

fangly added 8 commits May 5, 2017 10:26
* Because a vector is not good way to store checks (which are represented by heterogenous data types: strings, integers, lists, ...).
* This allows to check for the "range" Lint field, which is a list.
* In the docs, recommend to use named lists of checks instead of named vectors.
@fangly

fangly commented May 5, 2017

Copy link
Copy Markdown
Contributor Author

Hi Jim,
I found out that it was practically impossible to check the "ranges" of a lint using expect_lint(). I have now pushed a few changes in this PR to allow it. Additionally, expect_lint is now exported.
Cheers,
Florent

@jimhester

Copy link
Copy Markdown
Member

LGTM, thank you!

@jimhester
jimhester merged commit b48702b into master May 12, 2017
@fangly
fangly deleted the expect_from_string branch May 15, 2017 06:13
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

Successfully merging this pull request may close these issues.

3 participants