Add a simple description check for gerrit/projects.yaml

Add a very simple check for some common typos that might appear in the
descriptions.

Correct existing typos as found by the check

Change-Id: I6edd833de8544e44750c3a3fb49a065f99a18499
This commit is contained in:
Ian Wienand 2015-08-27 12:35:40 +10:00
parent 6a43970de5
commit 1942b394d6
2 changed files with 30 additions and 10 deletions

View File

@ -23,10 +23,10 @@
options:
- direct-release
- project: openstack-dev/devstack-plugin-cookiecutter
description: Cookiecutter Template for new devstack plugins
description: Cookiecutter Template for new DevStack plugins
acl-config: /home/gerrit2/acls/openstack-dev/devstack.config
- project: openstack-dev/devstack-vagrant
description: Vagrant scripts to build local devstack environments
description: Vagrant scripts to build local DevStack environments
- project: openstack-dev/grenade
description: OpenStack upgrade testing tool
- project: openstack-dev/hacking
@ -85,7 +85,7 @@
options:
- direct-release
- project: openstack-infra/devstack-gate
description: Run devstack in the gate
description: Run DevStack in the gate
use-storyboard: true
groups:
- openstack-ci
@ -926,14 +926,14 @@
- project: openstack/designate-specs
description: OpenStack DNS As A Service (Designate) Specifications
- project: openstack/devstack-plugin-amqp1
description: Devstack plugin to configure AMQP1.
description: DevStack plugin to configure AMQP1.
acl-config: /home/gerrit2/acls/openstack/oslo.messaging.config
groups:
- oslo
- project: openstack/devstack-plugin-hdfs
description: Devstack plugin to configure HDFS backend.
description: DevStack plugin to configure HDFS backend.
- project: openstack/devstack-plugin-zmq
description: Devstack plugin to configure ZMQ.
description: DevStack plugin to configure ZMQ.
acl-config: /home/gerrit2/acls/openstack/oslo.messaging.config
groups:
- oslo
@ -1816,9 +1816,9 @@
description: Agent for using Microsoft DNS Server with Designate
acl-config: /home/gerrit2/acls/openstack/designate.config
- project: stackforge/devstack-plugin-glusterfs
description: Devstack plugin to configure GlusterFS backend.
description: DevStack plugin to configure GlusterFS backend.
- project: stackforge/devstack-plugin-sheepdog
description: Devstack plugin to configure Sheepdog backend.
description: DevStack plugin to configure Sheepdog backend.
- project: stackforge/distil
description: Rating Service for OpenStack
acl-config: /home/gerrit2/acls/stackforge/distil.config
@ -1827,7 +1827,7 @@
- project: stackforge/dox
description: Run tests in a docker container
- project: stackforge/drbd-devstack
description: Devstack plugin to configure the DRBD backend.
description: DevStack plugin to configure the DRBD backend.
- project: stackforge/driverlog
description: Vendor drivers for OpenStack
- project: stackforge/ec2-api
@ -2079,7 +2079,7 @@
- project: stackforge/fuel-plugin-tls
groups:
- fuel
description: Fuel plugin to secure openstack using the Transport Layer Security
description: Fuel plugin to secure OpenStack using the Transport Layer Security
(TLS) protocol
docimpact-group: fuel
- project: stackforge/fuel-plugin-vmware-dvs

View File

@ -15,6 +15,7 @@
# limitations under the License.
import argparse
import re
import sys
import yaml
@ -52,6 +53,25 @@ for p in projects:
if args.verbose:
print('Checking %s' % name)
description = p.get('description')
# *very* simple check for common description mistakes
badwords = (
# (words), what_words_should_be
(('openstack', 'Openstack', 'Open Stack'), 'OpenStack'),
(('Devstack', 'devstack'), 'DevStack')
)
if description:
for words, should_be in badwords:
for word in words:
# look for the bad word hanging out on it's own. Only
# trick is "\b" doesn't consider "-" or '.' as a
# word-boundary, so ignore it if it looks like some
# sort of job-description (e.g. "foo-devstack-bar") or
# a url ("foo.openstack.org")
if re.search(r'(?<![-.])\b%s\b' % word, description):
print "Error: %s: should be %s" % (description, should_be)
found_errors += 1
if not description and repo_group in DESCRIPTION_REQUIRED:
found_errors += 1
print("Error: Project %s has no description" % name)