Skip to content

Different output for get_maintainer and get_authors when Authors@R field malformed #140

@maciekbanas

Description

@maciekbanas

First of all - thank you for the package. It does the job!

This issue is not critical, but I would prefer same output, when developer fills DESCRIPTION by hand and fails to write properly Authors@R field, e.g. forgets about last bracket ). For the time-being get_maintainer in that case returns character "NULL" which is awkward, while get_authors returns classic NULL.

Reprex below:

> desc_malformed_authors <- 
+   paste0("Package: TestPackage\nTitle: Test package\nVersion: 0.0.0.9000\n",
+          "Authors@R: \n    c(person(given = \"John\", family = \"Test\", \n ",
+          "email = \"john.test@tests.com\", \n role = c(\"aut\", \"cre\")),\n ",
+          "person(given = \"Joanna\", family = \"Checks\", \n ", 
+          "email = \"joanna.checks@tests.com\", \n role = c(\"aut\"))\n",
+          "Description: This package aims to test\n")
> desc_env <- desc::desc(text = desc_malformed_authors)
> desc_env
Package: TestPackage
Title: Test package
Version: 0.0.0.9000
Authors@R (parsed):
    * NULL
Description: This package aims to test
> desc_env$get_maintainer()
[1] "NULL"
> desc_env$get_authors()
NULL

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions