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

enable infix_spaces_linter, and apply it to the package #639

Merged
merged 9 commits into from
Dec 5, 2020

Conversation

MichaelChirico
Copy link
Collaborator

Closes #594

@AshesITR
Copy link
Collaborator

Codecov complains about uncovered code in object_name_linters.R (seems unused - remove?) and namespace.R (haven't looked into it)

@MichaelChirico
Copy link
Collaborator Author

I think the namespace one is actually a legit bug. namespace_imports is only called here:

https://github.com/jimhester/lintr/blob/fa05ceb2bf967ddad9230e25879b95084c80b0dc/R/object_name_linters.R#L57

without an argument. the default is to run find_package() (again without argument), but there's no default, so normalizePath always fails:

https://github.com/jimhester/lintr/blob/fa05ceb2bf967ddad9230e25879b95084c80b0dc/R/lint.R#L287

In namespace_imports this error happens within tryCatch so it just returns NULL.

I'm not sure the intended behavior but certainly the above is not it 😃

@MichaelChirico
Copy link
Collaborator Author

For the unused code in object_name_linters.R, I removed that code in #621, so let's just merge that one first.

Hopefully then we'll pass codecov here.

@AshesITR
Copy link
Collaborator

The intended behaviour seems to be to find_package() on the to-be-linted file, i.e. namespace_imports() needs the filename of the linted file, check for a DESCRIPTION and extract imports from other packages based on that information.
I'll create a follow-up issue from this.

Copy link
Collaborator

@AshesITR AshesITR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you :)

@AshesITR
Copy link
Collaborator

AshesITR commented Dec 4, 2020

R-devel apparently changed the error message for the lint we use in test-error.R.
I'll create a PR to allow the new error message ("unexpected end of line") as well as the old one ("unexpected input")

@AshesITR
Copy link
Collaborator

AshesITR commented Dec 4, 2020

Blocked by #659

@MichaelChirico
Copy link
Collaborator Author

The coverage miss here is caused by #642 -- I touched a region of code that's not reachable currently. Merging anyway, that should be tested as part of the fix to that issue.

@MichaelChirico MichaelChirico merged commit 5b638b9 into master Dec 5, 2020
@MichaelChirico MichaelChirico deleted the enable-infix-spaces branch December 5, 2020 20:55
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.

Make R/ conform to infix_spaces_linter
2 participants