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

use template for roles #3

Closed
jospueyo opened this issue Mar 21, 2023 · 1 comment
Closed

use template for roles #3

jospueyo opened this issue Mar 21, 2023 · 1 comment

Comments

@jospueyo
Copy link
Collaborator

@msperlin

The roles used in the code, as in "Conceptualization", "Methodology" and so on, should be defined in a single place. Do notice that you hard coded (wrote in a script) the roles in function create_template and in test test-read_template.

There are many ways to do it, but the simples is just using a function:

get_roles <- function() {

  roles <- c(
  "Conceptualization",
  "Methodology",
  "Software",
  "Validation",
  "Formal analysis",
  "Investigation",
  "Resources",
  "Data curation",
  "Writing - Original Draft",
  "Writing - Review & Editing",
  "Visualization",
  "Supervision",
  "Project administration",
  "Funding acquisition"
)

  return(roles)
}

With some simple webscrapping, you could use testthat to check if the template in the package is identical to the template from the site. Whenever the site adds or removes a role, your CHECK process will show it.

@jospueyo
Copy link
Collaborator Author

I added the functon roles_get() advancing the name convention suggested in the following issue. I also added a unit test that scraps CRediT and checks if roles are up-to-date. The test is skipped if rvest is not installed or if the tests are not run in local.

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

1 participant