Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Refactor conditional README items #105

Open
RichardLitt opened this issue Dec 27, 2016 · 0 comments
Open

Refactor conditional README items #105

RichardLitt opened this issue Dec 27, 2016 · 0 comments

Comments

@RichardLitt
Copy link
Collaborator

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)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant