コード例 #1
0
ファイル: APIDeviation.py プロジェクト: jedahan/gofed
	def importpath2pkgname(self, importpath):
		# TODO: maybe use some sort of cache of importpath -> packagename
		ip = ImportPath(importpath)
		if not ip.parse():
			return ""

		return ip.getPackageName()
コード例 #2
0
	def importpath2pkgname(self, importpath):
		# TODO: maybe use some sort of cache of importpath -> packagename
		ip = ImportPath(importpath)
		if not ip.parse():
			return ""

		return ip.getPackageName()
コード例 #3
0
    def testPackageName(self):
        name = self.sp_obj.getTag('name')
        url = self.sp_obj.getTag('url')

        if name == "":
            self.t_result = "E: Missing name tag"
            self.err_number += 1
            return False

        if url == "":
            self.t_result = "E: Missing url tag"
            self.err_number += 1
            return False

        ip_obj = ImportPath(url)
        if not ip_obj.parse():
            self.err = ip_obj.getError()
            return False

        pkg_name = ip_obj.getPackageName()
        if pkg_name == '':
            self.t_result = "E: Uknown repo url"
            self.err_number += 1
            return False

        if pkg_name != name:
            self.t_result = "W: Incorrect package name %s, should be %s" % (
                name, pkg_name)
            self.warn_number += 1
            return False

        self.t_result = "I: Package name correct"
        return True
コード例 #4
0
ファイル: GoLint.py プロジェクト: jedahan/gofed
	def testPackageName(self):
		name = self.sp_obj.getTag('name')
		url = self.sp_obj.getTag('url')

		if name == "":
			self.t_result = "E: Missing name tag"
			self.err_number += 1
			return False

		if url == "":
			self.t_result = "E: Missing url tag"
			self.err_number += 1
			return False

		ip_obj = ImportPath(url)
		if not ip_obj.parse():
			self.err = ip_obj.getError()
			return False

		pkg_name = ip_obj.getPackageName()
		if pkg_name == '':
			self.t_result = "E: Uknown repo url"
			self.err_number += 1
			return False

		if pkg_name != name:
			self.t_result = "W: Incorrect package name %s, should be %s" % (name, pkg_name)
			self.warn_number += 1
			return False

		self.t_result = "I: Package name correct"
		return True