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 (community) 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
=== modified file 'charmtools/charms.py'
--- charmtools/charms.py 2015-08-25 18:05:28 +0000
+++ charmtools/charms.py 2015-08-27 19:40:57 +0000
@@ -314,9 +314,9 @@
314 continue314 continue
315 lc += 1315 lc += 1
316 if l in readme_content:316 if l in readme_content:
317 err_msg = ('%s includes line %d of '317 err_msg = ('%s includes boilerplate: '
318 'boilerplate README.ex')318 '%s')
319 lint.warn(err_msg % (readme, lc))319 lint.warn(err_msg % (readme, l))
320 except IOError as e:320 except IOError as e:
321 lint.warn(321 lint.warn(
322 "Error while opening %s (%s)" %322 "Error while opening %s (%s)" %
323323
=== modified file 'tests_functional/proof/expected/broken-maintainer'
--- tests_functional/proof/expected/broken-maintainer 2014-12-05 21:04:40 +0000
+++ tests_functional/proof/expected/broken-maintainer 2015-08-27 19:40:57 +0000
@@ -2,7 +2,7 @@
2W: Maintainer format should be "Name <Email>", not "test@testhost"2W: Maintainer format should be "Name <Email>", not "test@testhost"
3W: no copyright file3W: no copyright file
4W: Includes template README.ex file4W: Includes template README.ex file
5W: README.ex includes line 1 of boilerplate README.ex5W: README.ex includes boilerplate: Describe the intended usage of this charm and anything unique about how this charm relates to others here.
6E: template interface names should be changed: interface-name6E: template interface names should be changed: interface-name
7E: template relations should be renamed to fit charm: relation-name7E: template relations should be renamed to fit charm: relation-name
8E: template interface names should be changed: interface-name8E: template interface names should be changed: interface-name
99
=== modified file 'tests_functional/proof/expected/icon-template'
--- tests_functional/proof/expected/icon-template 2014-10-22 20:02:21 +0000
+++ tests_functional/proof/expected/icon-template 2015-08-27 19:40:57 +0000
@@ -1,7 +1,7 @@
1I: Includes template icon.svg file.1I: Includes template icon.svg file.
2W: no copyright file2W: no copyright file
3W: Includes template README.ex file3W: Includes template README.ex file
4W: README.ex includes line 1 of boilerplate README.ex4W: README.ex includes boilerplate: Describe the intended usage of this charm and anything unique about how this charm relates to others here.
5E: template interface names should be changed: interface-name5E: template interface names should be changed: interface-name
6E: Unknown relation field in relation relation-name - (baz)6E: Unknown relation field in relation relation-name - (baz)
7E: template relations should be renamed to fit charm: relation-name7E: template relations should be renamed to fit charm: relation-name
88
=== modified file 'tests_functional/proof/expected/missing-maintainer'
--- tests_functional/proof/expected/missing-maintainer 2014-12-05 21:04:40 +0000
+++ tests_functional/proof/expected/missing-maintainer 2015-08-27 19:40:57 +0000
@@ -2,7 +2,7 @@
2E: Charm must have either a maintainer or maintainers field2E: Charm must have either a maintainer or maintainers field
3W: no copyright file3W: no copyright file
4W: Includes template README.ex file4W: Includes template README.ex file
5W: README.ex includes line 1 of boilerplate README.ex5W: README.ex includes boilerplate: Describe the intended usage of this charm and anything unique about how this charm relates to others here.
6E: template interface names should be changed: interface-name6E: template interface names should be changed: interface-name
7E: template relations should be renamed to fit charm: relation-name7E: template relations should be renamed to fit charm: relation-name
8E: template interface names should be changed: interface-name8E: template interface names should be changed: interface-name
99
=== modified file 'tests_functional/proof/expected/test'
--- tests_functional/proof/expected/test 2014-10-24 16:21:01 +0000
+++ tests_functional/proof/expected/test 2015-08-27 19:40:57 +0000
@@ -2,7 +2,7 @@
2I: No icon.svg file.2I: No icon.svg file.
3W: no copyright file3W: no copyright file
4W: Includes template README.ex file4W: Includes template README.ex file
5W: README.ex includes line 1 of boilerplate README.ex5W: README.ex includes boilerplate: Describe the intended usage of this charm and anything unique about how this charm relates to others here.
6E: template interface names should be changed: interface-name6E: template interface names should be changed: interface-name
7E: template relations should be renamed to fit charm: relation-name7E: template relations should be renamed to fit charm: relation-name
8E: template interface names should be changed: interface-name8E: template interface names should be changed: interface-name
99
=== modified file 'tests_functional/proof/expected/unknown-metadata'
--- tests_functional/proof/expected/unknown-metadata 2014-12-05 21:04:40 +0000
+++ tests_functional/proof/expected/unknown-metadata 2015-08-27 19:40:57 +0000
@@ -2,7 +2,7 @@
2I: metadata name (test) must match directory name (unknown-metadata) exactly for local deployment.2I: metadata name (test) must match directory name (unknown-metadata) exactly for local deployment.
3W: no copyright file3W: no copyright file
4W: Includes template README.ex file4W: Includes template README.ex file
5W: README.ex includes line 1 of boilerplate README.ex5W: README.ex includes boilerplate: Describe the intended usage of this charm and anything unique about how this charm relates to others here.
6E: template interface names should be changed: interface-name6E: template interface names should be changed: interface-name
7E: Unknown relation field in relation relation-name - (baz)7E: Unknown relation field in relation relation-name - (baz)
8E: template relations should be renamed to fit charm: relation-name8E: template relations should be renamed to fit charm: relation-name

Subscribers

People subscribed via source and target branches