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

Simplify DESCRIPTION check #149

Merged
merged 3 commits into from
Mar 5, 2021
Merged

Conversation

malcolmbarrett
Copy link
Contributor

This PR removes the tools-based DESCRIPTION file check and uses rprojroot to make a simpler check that the DESCRIPTION file exists in the project root and that it begins with ^Package. pkg_path() was already using rprojroot and was making this simpler check, so I beefed up that code a bit to make a clearer error message for the context.

This PR will simplify the use of loading non-package projects and closes #147.

Would it be helpful to add a test for a directory with an invalid pkg name and/or a directory without a DESCRIPTION file?

@jimhester
Copy link
Member

Can you please add a bullet to NEWS? It should briefly describe the change and end with (@yourname, #issuenumber).

@jimhester
Copy link
Member

And yes could you add a test case for this error, that would be great!

@malcolmbarrett
Copy link
Contributor Author

Both taken care of, thanks! I added a test for the no DESCRIPTION file error + added a class to the abort() call for easier testing. I thought about trying to test loading with an invalid pkg name but decided it was a little obvious that wouldn't complain about it since it's no longer being checked.

@jimhester jimhester merged commit 99f5deb into r-lib:master Mar 5, 2021
@jimhester
Copy link
Member

Thank you!

@malcolmbarrett malcolmbarrett deleted the desc_check branch March 5, 2021 19:45
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.

Loading when the package name is invalid
2 participants