Re: [arch-projects] [namcap][PATCH] check if the description is set in a PKGBUILD

2013-09-04 Thread Dan McGee
On Wed, Sep 4, 2013 at 7:24 AM, Jelle van der Waa  wrote:

> ---
>  Namcap/rules/missingvars.py | 7 +++
>  namcap-tags | 1 +
>  2 files changed, 8 insertions(+)
>
> diff --git a/Namcap/rules/missingvars.py b/Namcap/rules/missingvars.py
> index 90146f3..8211c1b 100644
> --- a/Namcap/rules/missingvars.py
> +++ b/Namcap/rules/missingvars.py
> @@ -76,4 +76,11 @@ class TagsRule(PkgbuildRule):
> if maintainertag != 1:
> self.warnings.append(("missing-maintainer", ()))
>
> +class DescSetRule(PkgbuildRule):
> +   name = "descset"
>
Why not just "Description"/"description" instead of "DescSet"/"descset"?

+   description = "Verifies that the description is set in a PKGBUILD"
> +   def analyze(self, pkginfo, tar):
> +   if "desc" not in pkginfo or len(pkginfo["desc"]) == 0:
> +   self.errors.append(("missing-description", ()))
> +
>  # vim: set ts=4 sw=4 noet:
> diff --git a/namcap-tags b/namcap-tags
> index 818c7a5..bb5f664 100644
> --- a/namcap-tags
> +++ b/namcap-tags
> @@ -47,6 +47,7 @@ link-level-dependence %s in %s :: Link-level dependence
> (%s) in file %s
>  lots-of-docs %f :: Package was %.0f%% docs by size; maybe you should
> split out a docs package
>  mime-cache-not-updated :: Mime-file found. Add "update-mime-database
> usr/share/mime" to the install file
>  missing-backup-file %s :: File in backup array (%s) not found in package
> +missing-description :: Missing description in PKGBUILD.
>
None of the rest of these end in a full stop; probably don't want to break
that convention here.


>  missing-contributor :: Missing Contributor tag
>  missing-custom-license-dir usr/share/licenses/%s :: Missing custom
> license directory (usr/share/licenses/%s)
>  missing-custom-license-file usr/share/licenses/%s/* :: Missing custom
> license file in package (usr/share/licenses/%s/*)
> --
> 1.8.4
>
>


[arch-projects] [namcap][PATCH] check if the description is set in a PKGBUILD

2013-09-04 Thread Jelle van der Waa
---
 Namcap/rules/missingvars.py | 7 +++
 namcap-tags | 1 +
 2 files changed, 8 insertions(+)

diff --git a/Namcap/rules/missingvars.py b/Namcap/rules/missingvars.py
index 90146f3..8211c1b 100644
--- a/Namcap/rules/missingvars.py
+++ b/Namcap/rules/missingvars.py
@@ -76,4 +76,11 @@ class TagsRule(PkgbuildRule):
if maintainertag != 1:
self.warnings.append(("missing-maintainer", ()))
 
+class DescSetRule(PkgbuildRule):
+   name = "descset"
+   description = "Verifies that the description is set in a PKGBUILD"
+   def analyze(self, pkginfo, tar):
+   if "desc" not in pkginfo or len(pkginfo["desc"]) == 0:
+   self.errors.append(("missing-description", ()))
+
 # vim: set ts=4 sw=4 noet:
diff --git a/namcap-tags b/namcap-tags
index 818c7a5..bb5f664 100644
--- a/namcap-tags
+++ b/namcap-tags
@@ -47,6 +47,7 @@ link-level-dependence %s in %s :: Link-level dependence (%s) 
in file %s
 lots-of-docs %f :: Package was %.0f%% docs by size; maybe you should split out 
a docs package
 mime-cache-not-updated :: Mime-file found. Add "update-mime-database 
usr/share/mime" to the install file
 missing-backup-file %s :: File in backup array (%s) not found in package
+missing-description :: Missing description in PKGBUILD.
 missing-contributor :: Missing Contributor tag
 missing-custom-license-dir usr/share/licenses/%s :: Missing custom license 
directory (usr/share/licenses/%s)
 missing-custom-license-file usr/share/licenses/%s/* :: Missing custom license 
file in package (usr/share/licenses/%s/*)
-- 
1.8.4