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
=== modified file 'clickreviews/cr_lint.py'
--- clickreviews/cr_lint.py 2015-04-10 16:22:20 +0000
+++ clickreviews/cr_lint.py 2015-04-15 20:57:04 +0000
@@ -707,39 +707,6 @@
707 click_package_bn707 click_package_bn
708 self._add_result(t, n, s)708 self._add_result(t, n, s)
709709
710 # handle $pkgname.click or $pkgname.snap
711 if self.click_package.endswith('.snap'):
712 pkgname = tmp[0].partition('.snap')[0]
713 else:
714 pkgname = tmp[0].partition('.click')[0]
715 t = 'info'
716 n = 'package_filename_pkgname_match'
717 s = 'OK'
718 l = None
719 if pkgname != self.click_pkgname:
720 if pkgname.startswith('com.ubuntu.snappy.') or \
721 click_package_bn.startswith('com.ubuntu.snappy.'):
722 s = "OK (store snappy workaround)"
723 else:
724 t = 'error'
725 s = "'%s' != '%s' from DEBIAN/control" % (pkgname,
726 self.click_pkgname)
727 l = 'http://askubuntu.com/questions/417361/what-does-lint-package-filename-pkgname-match-mean'
728 self._add_result(t, n, s, l)
729
730 # check if namespaces matches with filename
731 t = 'info'
732 n = 'package_filename_matches_namespace'
733 s = 'OK'
734 namespace_bits = self.click_pkgname.split('.')[:-1]
735 len_namespace = len(namespace_bits)
736 pkgname_bits = pkgname.split('.')[:len_namespace]
737 if namespace_bits != pkgname_bits:
738 t = 'error'
739 s = "Package name '%s' does not match namespace '%s'." % \
740 ('.'.join(namespace_bits), '.'.join(pkgname_bits))
741 self._add_result(t, n, s)
742
743 t = 'info'710 t = 'info'
744 n = 'package_filename_version_match'711 n = 'package_filename_version_match'
745 s = 'OK'712 s = 'OK'
746713
=== modified file 'clickreviews/tests/test_cr_lint.py'
--- clickreviews/tests/test_cr_lint.py 2015-04-10 10:36:49 +0000
+++ clickreviews/tests/test_cr_lint.py 2015-04-15 20:57:04 +0000
@@ -221,7 +221,7 @@
221 c = ClickReviewLint(test_name)221 c = ClickReviewLint(test_name)
222 c.check_package_filename()222 c.check_package_filename()
223 r = c.click_report223 r = c.click_report
224 expected_counts = {'info': None, 'warn': 3, 'error': 3}224 expected_counts = {'info': None, 'warn': 3, 'error': 1}
225 self.check_results(r, expected_counts)225 self.check_results(r, expected_counts)
226226
227 def test_check_package_filename_extra_underscore(self):227 def test_check_package_filename_extra_underscore(self):
@@ -232,27 +232,7 @@
232 c = ClickReviewLint(test_name)232 c = ClickReviewLint(test_name)
233 c.check_package_filename()233 c.check_package_filename()
234 r = c.click_report234 r = c.click_report
235 expected_counts = {'info': None, 'warn': 2, 'error': 4}235 expected_counts = {'info': None, 'warn': 2, 'error': 2}
236 self.check_results(r, expected_counts)
237
238 def test_check_package_filename_control_mismatches(self):
239 '''Test check_package_filename() (control mismatches filename)'''
240 self.set_test_control("Package", "test-match")
241 c = ClickReviewLint(self.test_name)
242 c.check_package_filename()
243 r = c.click_report
244 expected_counts = {'info': None, 'warn': 0, 'error': 1}
245 self.check_results(r, expected_counts)
246
247 def test_check_package_filename_namespace_mismatches(self):
248 '''Test check_package_filename() (control mismatches filename)'''
249 test_name = "%s_%s_%s.click" % ("com.example.someuser",
250 self.test_control['Version'],
251 self.test_control['Architecture'])
252 c = ClickReviewLint(test_name)
253 c.check_package_filename()
254 r = c.click_report
255 expected_counts = {'info': None, 'warn': 0, 'error': 2}
256 self.check_results(r, expected_counts)236 self.check_results(r, expected_counts)
257237
258 def test_check_package_filename_version_mismatches(self):238 def test_check_package_filename_version_mismatches(self):

Subscribers

People subscribed via source and target branches