ipfs-inactive / project-repos

[ARCHIVED] Project health metrics
http://project-repos.ipfs.io/
MIT License
7 stars 8 forks source link

Refactor conditional README items #105

Open RichardLitt opened 7 years ago

RichardLitt commented 7 years ago

This section:

  README_SECTIONS =
    'ToC': -> 'Table of Contents'
    'Install': -> '## Install'
    'Usage': -> '## Usage'
    'Contribute': -> '## Contribute'
    'License': -> '## License'

Should include the checks currently here:

for name, template of README_ITEMS                                                       # Badges
              expectedMarkdown = template repo.fullName
              if name == 'ToC'
                if repo.files[README]?.split('\n').length < 100
                  td class: 'no-padding', => @check('na')
                else
                  td class: 'no-padding', => @check(repo.files[README]?.indexOf(expectedMarkdown) >= 0)
              else if name == 'Install' || name == 'Usage'
                if repo.files[README]?.match('This repository is (only for documents|a \\*\\*work in progress\\*\\*)\\.')
                  td class: 'no-padding', => @check('na')
                else
                  td class: 'no-padding', => @check(repo.files[README]?.indexOf(expectedMarkdown) >= 0)
              else if name == 'TODO'
                td class: 'no-padding', => @check(repo.files[README]?.indexOf(expectedMarkdown) == -1)
              else
                td class: 'no-padding', => @check(repo.files[README]?.indexOf(expectedMarkdown) >= 0)