Merge lp:~lazypower/charm-tools/refactor-readme-lint into lp:charm-tools/1.6

Proposed by Charles Butler
Status: Merged
Merged at revision: 358
Proposed branch: lp:~lazypower/charm-tools/refactor-readme-lint
Merge into: lp:charm-tools/1.6
Diff against target: 81 lines (+8/-8)
6 files modified
charmtools/charms.py (+3/-3)
tests_functional/proof/expected/broken-maintainer (+1/-1)
tests_functional/proof/expected/icon-template (+1/-1)
tests_functional/proof/expected/missing-maintainer (+1/-1)
tests_functional/proof/expected/test (+1/-1)
tests_functional/proof/expected/unknown-metadata (+1/-1)
To merge this branch: bzr merge lp:~lazypower/charm-tools/refactor-readme-lint
Reviewer Review Type Date Requested Status
Tim Van Steenburgh Approve
Review via email: mp+266784@code.launchpad.net

Description of the change

Refactored the README.ex lint to spit out the matched line contents, vs the line number.

When linting a charm, matched README.ex boilerplate line number isn't terribly helpful, but knowing what content we have matched really helps to narrow down what has matched. This may not be the right approach but it certainly starts the conversation.

To post a comment you must log in.
Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

`make check` fails now, e.g.:

--- tests_functional/proof/expected/unknown-metadata 2015-08-25 14:56:08.755392000 -0400
+++ tests_functional/proof/results/unknown-metadata 2015-08-27 15:24:25.685029478 -0400
@@ -2,7 +2,7 @@
 I: metadata name (test) must match directory name (unknown-metadata) exactly for local deployment.
 W: no copyright file
 W: Includes template README.ex file
-W: README.ex includes line 1 of boilerplate README.ex
+W: Boilerplate readmeidentified in README.ex: Describe the intended usage of this charm and anything unique about how this charm relates to others here.
 E: template interface names should be changed: interface-name
 E: Unknown relation field in relation relation-name - (baz)
 E: template relations should be renamed to fit charm: relation-name

review: Needs Fixing
356. By Charles Butler

Updates the check targets for the new verbiage and refactors the verbiage of
the linter to reflect what existed before the modification

Revision history for this message
Tim Van Steenburgh (tvansteenburgh) wrote :

LGTM, thanks Chuck.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmtools/charms.py'
2--- charmtools/charms.py 2015-08-25 18:05:28 +0000
3+++ charmtools/charms.py 2015-08-27 19:40:57 +0000
4@@ -314,9 +314,9 @@
5 continue
6 lc += 1
7 if l in readme_content:
8- err_msg = ('%s includes line %d of '
9- 'boilerplate README.ex')
10- lint.warn(err_msg % (readme, lc))
11+ err_msg = ('%s includes boilerplate: '
12+ '%s')
13+ lint.warn(err_msg % (readme, l))
14 except IOError as e:
15 lint.warn(
16 "Error while opening %s (%s)" %
17
18=== modified file 'tests_functional/proof/expected/broken-maintainer'
19--- tests_functional/proof/expected/broken-maintainer 2014-12-05 21:04:40 +0000
20+++ tests_functional/proof/expected/broken-maintainer 2015-08-27 19:40:57 +0000
21@@ -2,7 +2,7 @@
22 W: Maintainer format should be "Name <Email>", not "test@testhost"
23 W: no copyright file
24 W: Includes template README.ex file
25-W: README.ex includes line 1 of boilerplate README.ex
26+W: README.ex includes boilerplate: Describe the intended usage of this charm and anything unique about how this charm relates to others here.
27 E: template interface names should be changed: interface-name
28 E: template relations should be renamed to fit charm: relation-name
29 E: template interface names should be changed: interface-name
30
31=== modified file 'tests_functional/proof/expected/icon-template'
32--- tests_functional/proof/expected/icon-template 2014-10-22 20:02:21 +0000
33+++ tests_functional/proof/expected/icon-template 2015-08-27 19:40:57 +0000
34@@ -1,7 +1,7 @@
35 I: Includes template icon.svg file.
36 W: no copyright file
37 W: Includes template README.ex file
38-W: README.ex includes line 1 of boilerplate README.ex
39+W: README.ex includes boilerplate: Describe the intended usage of this charm and anything unique about how this charm relates to others here.
40 E: template interface names should be changed: interface-name
41 E: Unknown relation field in relation relation-name - (baz)
42 E: template relations should be renamed to fit charm: relation-name
43
44=== modified file 'tests_functional/proof/expected/missing-maintainer'
45--- tests_functional/proof/expected/missing-maintainer 2014-12-05 21:04:40 +0000
46+++ tests_functional/proof/expected/missing-maintainer 2015-08-27 19:40:57 +0000
47@@ -2,7 +2,7 @@
48 E: Charm must have either a maintainer or maintainers field
49 W: no copyright file
50 W: Includes template README.ex file
51-W: README.ex includes line 1 of boilerplate README.ex
52+W: README.ex includes boilerplate: Describe the intended usage of this charm and anything unique about how this charm relates to others here.
53 E: template interface names should be changed: interface-name
54 E: template relations should be renamed to fit charm: relation-name
55 E: template interface names should be changed: interface-name
56
57=== modified file 'tests_functional/proof/expected/test'
58--- tests_functional/proof/expected/test 2014-10-24 16:21:01 +0000
59+++ tests_functional/proof/expected/test 2015-08-27 19:40:57 +0000
60@@ -2,7 +2,7 @@
61 I: No icon.svg file.
62 W: no copyright file
63 W: Includes template README.ex file
64-W: README.ex includes line 1 of boilerplate README.ex
65+W: README.ex includes boilerplate: Describe the intended usage of this charm and anything unique about how this charm relates to others here.
66 E: template interface names should be changed: interface-name
67 E: template relations should be renamed to fit charm: relation-name
68 E: template interface names should be changed: interface-name
69
70=== modified file 'tests_functional/proof/expected/unknown-metadata'
71--- tests_functional/proof/expected/unknown-metadata 2014-12-05 21:04:40 +0000
72+++ tests_functional/proof/expected/unknown-metadata 2015-08-27 19:40:57 +0000
73@@ -2,7 +2,7 @@
74 I: metadata name (test) must match directory name (unknown-metadata) exactly for local deployment.
75 W: no copyright file
76 W: Includes template README.ex file
77-W: README.ex includes line 1 of boilerplate README.ex
78+W: README.ex includes boilerplate: Describe the intended usage of this charm and anything unique about how this charm relates to others here.
79 E: template interface names should be changed: interface-name
80 E: Unknown relation field in relation relation-name - (baz)
81 E: template relations should be renamed to fit charm: relation-name

Subscribers

People subscribed via source and target branches