tomaszaba / ipccheckr

Toolkit for Performing IPC Acute Malnutrition-related Data Checks
GNU General Public License v3.0
2 stars 0 forks source link

suggest to normalise the structure of contents in DESCRIPTION file #7

Closed ernestguevarra closed 3 months ago

ernestguevarra commented 4 months ago

Whilst it is not important or will not cause any errors, it is nice to have the DESCRIPTION file structured in a more organised way, something like this:

Type: Package
Package: ipccheckr
Title: Toolkit for Performing IPC Acute Malnutrition-related Data
    Checks
Version: 0.0.0.9000
Authors@R (parsed):
    * Tomás Zaba <tomas.zaba@outlook.com> [aut, cre, cph] (<https://orcid.org/0000-0002-7079-3574>)
    * Ernest Guevarra [aut, cph] (<https://orcid.org/0000-0002-4887-4415>)
    * Douglas Jayasekaran [ctb]
Description: The Integrated Food Security Phase Classification
    (IPC) for Acute Malnutrition is a global tool used to classify
    geographical areas based on the prevalence of acute malnutrition. An
    IPC AMN product is primarily used to inform countries Humanitarian
    Needs Overview (HNO) of the Humanitarian Programme Cycle (HPC). The
    accepted sources of evidence on prevalence of acute malnutrition
    varies from surveys, community-based screenings and sent- inel sites.
    According to the IPC AMN protocols, every evidence must be subject to
    quality checks to ascertain their reliability and decided whether to
    use or not. This package provides useful functions and utilities that
    supports IPC AMN-related data analysis check.
License: GPL (>= 3)
URL: https://github.com/tomaszaba/ipccheckr
BugReports: https://github.com/tomaszaba/ipccheckr/issues
Imports:
    dplyr (>= 1.1.4),
    ggplot2 (>= 3.5.1),
    nipnTK (>= 0.2.0),
    zscorer (>= 0.3.1)
Suggests:
    scales (>= 1.3.0),
    spelling,
    testthat (>= 3.0.0)
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-GB
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1

You can get this output using the {desc} package (see https://github.com/r-lib/desc) using the desc_normalize() function. This function will print the output above which you can copy paste to replace your DESCRIPTION file contents.

tomaszaba commented 4 months ago

This is great! Thank you. I have updated the file on my local report. Will get updated when I commit --> push

tomaszaba commented 4 months ago

Hi again, Ernest,

I implemented your suggestion: desc_normalize() and I get DESCRIPTION file gets updated automatically to this format:

Package: ipccheckr
Title: Toolkit for Performing IPC Acute Malnutrition-related Data Checks
Version: 0.0.0.9000
Authors@R: c(
    person("Tomás", "Zaba", , "tomas.zaba@outlook.com", role = c("aut", "cre", "cph"),
           comment = c(ORCID = "0000-0002-7079-3574")),
    person("Ernest", "Guevarra", role = c("aut", "cph"),
           comment = c(ORCID = "0000-0002-4887-4415")),
    person("Douglas", "Jayasekaran", role = "ctb")
  )
Description: The Integrated Food Security Phase Classification (IPC) for
    Acute Malnutrition is a global tool used to classify geographical
    areas based on the prevalence of acute malnutrition. An IPC AMN
    product is primarily used to inform countries Humanitarian Needs
    Overview (HNO) of the Humanitarian Programme Cycle (HPC). The accepted
    sources of evidence on prevalence of acute malnutrition varies from
    surveys, community-based screenings and sent- inel sites. According to
    the IPC AMN protocols, every evidence must be subject to quality
    checks to ascertain their reliability and decided whether to use or
    not. This package provides useful functions and utilities that
    supports IPC AMN-related data analysis check.
License: GPL (>= 3)
URL: https://github.com/tomaszaba/ipccheckr
BugReports: https://github.com/tomaszaba/ipccheckr/issues
Imports: 
    dplyr (>= 1.1.4)
Suggests: 
    scales (>= 1.3.0),
    spelling,
    testthat (>= 3.0.0)
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-GB
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1`

this works fine with devtools:check().

But when I implement your suggestion to copy and past the printed output of desc_normalize():

Type: Package
Package: ipccheckr
Title: Toolkit for Performing IPC Acute Malnutrition-related Data
    Checks
Version: 0.0.0.9000
Authors@R (parsed):
    * Tomás Zaba <tomas.zaba@outlook.com> [aut, cre, cph] (<https://orcid.org/0000-0002-7079-3574>)
    * Ernest Guevarra [aut, cph] (<https://orcid.org/0000-0002-4887-4415>)
    * Douglas Jayasekaran [ctb]
Description: The Integrated Food Security Phase Classification
    (IPC) for Acute Malnutrition is a global tool used to classify
    geographical areas based on the prevalence of acute malnutrition. An
    IPC AMN product is primarily used to inform countries Humanitarian
    Needs Overview (HNO) of the Humanitarian Programme Cycle (HPC). The
    accepted sources of evidence on prevalence of acute malnutrition
    varies from surveys, community-based screenings and sent- inel sites.
    According to the IPC AMN protocols, every evidence must be subject to
    quality checks to ascertain their reliability and decided whether to
    use or not. This package provides useful functions and utilities that
    supports IPC AMN-related data analysis check.
License: GPL (>= 3)
URL: https://github.com/tomaszaba/ipccheckr
BugReports: https://github.com/tomaszaba/ipccheckr/issues
Imports:
    dplyr (>= 1.1.4)
Suggests:
    scales (>= 1.3.0),
    spelling,
    testthat (>= 3.0.0)
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-GB
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1

This fails with devtools::check()

E  checking for file 'ipccheckr/DESCRIPTION'
   Required fields missing or empty:
     'Author' 'Maintainer'

   See
     'C:/Users/AAH/AppData/Local/Temp/RtmpO0KW69/file30d072a253cd/ipccheckr.Rcheck/00check.log'
   for details.
ernestguevarra commented 4 months ago

don't copy paste. use the changes made on DESCRIPTION already.