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

create_codemeta() may lead to 'Error in !auto : invalid argument type' #238

Closed
RLumSK opened this issue Aug 2, 2019 · 4 comments
Closed

Comments

@RLumSK
Copy link
Contributor

RLumSK commented Aug 2, 2019

First thanks for this package, I think it is of great value for the community!

I noticed that create_codemeta() (path is the package path) stops with throwing

Error in !auto : invalid argument type 

This error is caused by the function read_citation_with_encoding() (parse_citation.R) which calls utils::readCitationFile(citation_file, meta = meta) and it happens if the CITATION file contains the following line:

citation(auto = meta)

This is nothing special and works on CRAN, since meta comes with the correct information the moment the package is built on CRAN. I raised a similar issue a while ago in 'pkgdown'
(r-lib/pkgdown#493), for which a working solution was found.

@cboettig
Copy link
Member

cboettig commented Aug 2, 2019

Thanks for the detailed report! Looks like we could probably bootstrap something based on the pkgdown solution... @maelle any thoughts?

@maelle
Copy link
Member

maelle commented Aug 2, 2019

Thanks for the bug report! @cboettig I am on maternity leave so can't look into code at the moment. 👶

RLumSK added a commit to RLumSK/codemetar that referenced this issue Aug 3, 2019
+ Add NEWS
@RLumSK
Copy link
Contributor Author

RLumSK commented Aug 3, 2019

I proposed a solution to this problem with my PR, this solution is a little bit different from what was done in 'pkgdown', however, it addresses the issue and the function does not break anymore.

(Sorry, I realised too late that the new PR stacks with my previous pending PR, I should have better created a new branch from master.)

cboettig pushed a commit that referenced this issue Aug 5, 2019
* Add tempdir() to avoid to writing guess_other_metadata() into the parent directory.

* + swap the default
+ updating the roxygen docs

* + Add myself as a ctb in DESCRIPTION

* + mention of changes in NEWS.md
+ linking this PR

* Address #240 and avoid pre-commit hook without user consent

* Correct link in NEWS.md #240

* Modify the way the file size is calculated.

+ Amend guess_fileSize() in guess_other_metadata.R as proposed #239
+ Update tests
+ Drop dependency to 'pkgbuild'
+ Add NEWS in NEWS.md

* Modify the way the file size is calculated.

+ Amend guess_fileSize() in guess_other_metadata.R as proposed #239
+ Update tests
+ Drop dependency to 'pkgbuild'
+ Update documentation in 'write_codemeta()'
+ Upddate corresponding Rd-files
+ Add NEWS in NEWS.md

* Address #238

+ Add NEWS

* Update tests and add CITATION_ex2 #241
@cboettig
Copy link
Member

cboettig commented Aug 5, 2019

closed by #241

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

3 participants