Merge lp://qastaging/~clint-fewbar/charm-tools/flag-readme into lp://qastaging/~charmers/charm-tools/trunk

Proposed by Clint Byrum
Status: Merged
Approved by: Marco Ceppi
Approved revision: 165
Merged at revision: 165
Proposed branch: lp://qastaging/~clint-fewbar/charm-tools/flag-readme
Merge into: lp://qastaging/~charmers/charm-tools/trunk
Diff against target: 102 lines (+34/-0)
6 files modified
scripts/proof (+23/-0)
tests/charms/mod-spdy/README (+3/-0)
tests/proof/expected/broken-maintainer (+2/-0)
tests/proof/expected/missing-maintainer (+2/-0)
tests/proof/expected/test (+2/-0)
tests/proof/expected/unknown-metadata (+2/-0)
To merge this branch: bzr merge lp://qastaging/~clint-fewbar/charm-tools/flag-readme
Reviewer Review Type Date Requested Status
Martin Packman (community) Approve
Marco Ceppi (community) Approve
Review via email: mp+129345@code.qastaging.launchpad.net

Description of the change

Flag instances of the boilerplate lines of the README.ex in a README so that
if somebody just renames the file blindly we get an E:

To post a comment you must log in.
Revision history for this message
Marco Ceppi (marcoceppi) wrote :

LGTM!

review: Approve
Revision history for this message
Martin Packman (gz) wrote :

This will throw an error if the readme contains the line "-----\n" say. Only checking non-trivial lines (20 chars or more for instance).

+ for l in [ x.strip() for x in tr]:
...
+ tr.seek(0)

Rather than iterating over the file multiple times and seeking back to the start, do it once and reuse this list. For instance:

    try:
        bad_lines = []
        with open(TEMPLATE_README) as tr:
            for line in tr:
                if len(line) > 20:
                    bad_lines.append(line.strip())
        for readme in found_readmes:
            ...
    except ...

review: Needs Fixing
166. By Clint Byrum

address case where short lines in the example README are common idioms

167. By Clint Byrum

Adding short lines from README.ex to test short line heuristic

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Thanks Martin, I think I've addressed it with the last commit. Can you review again?

Revision history for this message
Martin Packman (gz) wrote :

+ tr.seek(0)

This is harmless but now redundant.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches