Skip to content

enable infix_spaces_linter, and apply it to the package - #639

Merged
MichaelChirico merged 9 commits into
masterfrom
enable-infix-spaces
Dec 5, 2020
Merged

MichaelChirico merged 9 commits into
masterfrom
enable-infix-spaces

Conversation

@MichaelChirico

Copy link
Copy Markdown
Collaborator

Closes #594

@AshesITR

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@AshesITR AshesITR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you :)

@AshesITR

AshesITR commented Dec 4, 2020

Copy link
Copy Markdown
Collaborator

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

AshesITR commented Dec 4, 2020

Copy link
Copy Markdown
Collaborator

Blocked by #659

@MichaelChirico

Copy link
Copy Markdown
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