Merge lp:~james-w/click-reviewers-tools/drop-name-check into lp:click-reviewers-tools

Proposed by James Westby
Status: Merged
Merged at revision: 437
Proposed branch: lp:~james-w/click-reviewers-tools/drop-name-check
Merge into: lp:click-reviewers-tools
Diff against target: 85 lines (+2/-55)
2 files modified
clickreviews/cr_lint.py (+0/-33)
clickreviews/tests/test_cr_lint.py (+2/-22)
To merge this branch: bzr merge lp:~james-w/click-reviewers-tools/drop-name-check
Reviewer Review Type Date Requested Status
Daniel Holbach (community) Approve
Martin Albisetti (community) Approve
Review via email: mp+256396@code.launchpad.net

Commit message

Drop the checks on the package name in the filename.

The filename doesn't matter, and the store generates it anyway,
so checking it is a waste, and keeps breaking as we change the
rules.

To post a comment you must log in.
Revision history for this message
Martin Albisetti (beuno) :
review: Approve
Revision history for this message
Daniel Holbach (dholbach) wrote :

Makes sense, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'clickreviews/cr_lint.py'
2--- clickreviews/cr_lint.py 2015-04-10 16:22:20 +0000
3+++ clickreviews/cr_lint.py 2015-04-15 20:57:04 +0000
4@@ -707,39 +707,6 @@
5 click_package_bn
6 self._add_result(t, n, s)
7
8- # handle $pkgname.click or $pkgname.snap
9- if self.click_package.endswith('.snap'):
10- pkgname = tmp[0].partition('.snap')[0]
11- else:
12- pkgname = tmp[0].partition('.click')[0]
13- t = 'info'
14- n = 'package_filename_pkgname_match'
15- s = 'OK'
16- l = None
17- if pkgname != self.click_pkgname:
18- if pkgname.startswith('com.ubuntu.snappy.') or \
19- click_package_bn.startswith('com.ubuntu.snappy.'):
20- s = "OK (store snappy workaround)"
21- else:
22- t = 'error'
23- s = "'%s' != '%s' from DEBIAN/control" % (pkgname,
24- self.click_pkgname)
25- l = 'http://askubuntu.com/questions/417361/what-does-lint-package-filename-pkgname-match-mean'
26- self._add_result(t, n, s, l)
27-
28- # check if namespaces matches with filename
29- t = 'info'
30- n = 'package_filename_matches_namespace'
31- s = 'OK'
32- namespace_bits = self.click_pkgname.split('.')[:-1]
33- len_namespace = len(namespace_bits)
34- pkgname_bits = pkgname.split('.')[:len_namespace]
35- if namespace_bits != pkgname_bits:
36- t = 'error'
37- s = "Package name '%s' does not match namespace '%s'." % \
38- ('.'.join(namespace_bits), '.'.join(pkgname_bits))
39- self._add_result(t, n, s)
40-
41 t = 'info'
42 n = 'package_filename_version_match'
43 s = 'OK'
44
45=== modified file 'clickreviews/tests/test_cr_lint.py'
46--- clickreviews/tests/test_cr_lint.py 2015-04-10 10:36:49 +0000
47+++ clickreviews/tests/test_cr_lint.py 2015-04-15 20:57:04 +0000
48@@ -221,7 +221,7 @@
49 c = ClickReviewLint(test_name)
50 c.check_package_filename()
51 r = c.click_report
52- expected_counts = {'info': None, 'warn': 3, 'error': 3}
53+ expected_counts = {'info': None, 'warn': 3, 'error': 1}
54 self.check_results(r, expected_counts)
55
56 def test_check_package_filename_extra_underscore(self):
57@@ -232,27 +232,7 @@
58 c = ClickReviewLint(test_name)
59 c.check_package_filename()
60 r = c.click_report
61- expected_counts = {'info': None, 'warn': 2, 'error': 4}
62- self.check_results(r, expected_counts)
63-
64- def test_check_package_filename_control_mismatches(self):
65- '''Test check_package_filename() (control mismatches filename)'''
66- self.set_test_control("Package", "test-match")
67- c = ClickReviewLint(self.test_name)
68- c.check_package_filename()
69- r = c.click_report
70- expected_counts = {'info': None, 'warn': 0, 'error': 1}
71- self.check_results(r, expected_counts)
72-
73- def test_check_package_filename_namespace_mismatches(self):
74- '''Test check_package_filename() (control mismatches filename)'''
75- test_name = "%s_%s_%s.click" % ("com.example.someuser",
76- self.test_control['Version'],
77- self.test_control['Architecture'])
78- c = ClickReviewLint(test_name)
79- c.check_package_filename()
80- r = c.click_report
81- expected_counts = {'info': None, 'warn': 0, 'error': 2}
82+ expected_counts = {'info': None, 'warn': 2, 'error': 2}
83 self.check_results(r, expected_counts)
84
85 def test_check_package_filename_version_mismatches(self):

Subscribers

People subscribed via source and target branches