From 4ed51d077ed38a7592c1da0f5ab5865d20fa8560 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 1 Jun 2016 14:42:38 -0400 Subject: [PATCH] do not allow specs with zwsp characters For some reason a number of specs (and docs) have zwsp characters inserted in URLs. This causes crud in the reviews, and really confusing errors around line lengths for people (we count them, but they aren't seen in their editor). This removes them and makes a test to make sure they never come back. Change-Id: Ib6e94725e2716dbb2ff86f272fbe4a6987714444 --- specs/liberty/approved/user-data-modification.rst | 2 +- .../show-reserved-status-in-os-fixed-ips-api.rst | 2 +- specs/mitaka/approved/nova-api-hypervsor-cpu-info.rst | 2 +- specs/mitaka/approved/user-data-modification.rst | 2 +- specs/newton/approved/console-log-offset.rst | 2 +- specs/newton/approved/nova-api-hypervsor-cpu-info.rst | 2 +- tests/test_titles.py | 8 ++++++++ 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/specs/liberty/approved/user-data-modification.rst b/specs/liberty/approved/user-data-modification.rst index dd1f62797..6a56bbebe 100644 --- a/specs/liberty/approved/user-data-modification.rst +++ b/specs/liberty/approved/user-data-modification.rst @@ -51,7 +51,7 @@ REST API impact The method: -"/v2/​{tenant_id}​/servers/​{server_id}"​ +"/v2/{tenant_id}/servers/{server_id}" With the method type PUT. diff --git a/specs/liberty/implemented/show-reserved-status-in-os-fixed-ips-api.rst b/specs/liberty/implemented/show-reserved-status-in-os-fixed-ips-api.rst index 5cf9aea67..14cdf23a2 100644 --- a/specs/liberty/implemented/show-reserved-status-in-os-fixed-ips-api.rst +++ b/specs/liberty/implemented/show-reserved-status-in-os-fixed-ips-api.rst @@ -75,7 +75,7 @@ minimum supported version. * 404: If the address on the request does not match a FixedIP entry in the database. - * ``/v2.1/​{tenant_id}​/os-fixed-ips/​{fixed_ip}​`` + * ``/v2.1/{tenant_id}/os-fixed-ips/{fixed_ip}`` * Parameters which can be passed via the url: The fixed IP address diff --git a/specs/mitaka/approved/nova-api-hypervsor-cpu-info.rst b/specs/mitaka/approved/nova-api-hypervsor-cpu-info.rst index de2f56c3e..971db3625 100644 --- a/specs/mitaka/approved/nova-api-hypervsor-cpu-info.rst +++ b/specs/mitaka/approved/nova-api-hypervsor-cpu-info.rst @@ -99,7 +99,7 @@ REST API impact Change in should be added in a new API microversion: -`GET /v2.1/os-hypervisors/​{hypervisor_id}​` +`GET /v2.1/os-hypervisors/{hypervisor_id}` Show hypervisor details Shows details for a specified hypervisor. diff --git a/specs/mitaka/approved/user-data-modification.rst b/specs/mitaka/approved/user-data-modification.rst index dd1f62797..6a56bbebe 100644 --- a/specs/mitaka/approved/user-data-modification.rst +++ b/specs/mitaka/approved/user-data-modification.rst @@ -51,7 +51,7 @@ REST API impact The method: -"/v2/​{tenant_id}​/servers/​{server_id}"​ +"/v2/{tenant_id}/servers/{server_id}" With the method type PUT. diff --git a/specs/newton/approved/console-log-offset.rst b/specs/newton/approved/console-log-offset.rst index ea9fa7ec3..2983db55d 100644 --- a/specs/newton/approved/console-log-offset.rst +++ b/specs/newton/approved/console-log-offset.rst @@ -54,7 +54,7 @@ if log doesn't contain this offset response should be empty. Request: URL: - /v2.1/​{tenant_id}​/servers/​{server_id}​/action + /v2.1/{tenant_id}/servers/{server_id}/action Method: diff --git a/specs/newton/approved/nova-api-hypervsor-cpu-info.rst b/specs/newton/approved/nova-api-hypervsor-cpu-info.rst index eb6716d48..c6a01bce3 100644 --- a/specs/newton/approved/nova-api-hypervsor-cpu-info.rst +++ b/specs/newton/approved/nova-api-hypervsor-cpu-info.rst @@ -99,7 +99,7 @@ REST API impact Change in should be added in a new API microversion: -`GET /v2.1/os-hypervisors/​{hypervisor_id}​` +`GET /v2.1/os-hypervisors/{hypervisor_id}` Show hypervisor details Shows details for a specified hypervisor. diff --git a/tests/test_titles.py b/tests/test_titles.py index 6905003f8..8359b109d 100644 --- a/tests/test_titles.py +++ b/tests/test_titles.py @@ -96,6 +96,13 @@ class TestTitles(testtools.TestCase): "Found %s literal carriage returns in file %s" % (len(matches), tpl)) + def _check_no_zwsp(self, tpl, raw): + matches = raw.decode('utf-8').find(u"\u200B") + self.assertEqual( + matches, -1, + "Found zero width space characters in file %s" % + (tpl)) + def _check_trailing_spaces(self, tpl, raw): for i, line in enumerate(raw.split("\n")): trailing_spaces = re.findall(" +$", line) @@ -124,4 +131,5 @@ class TestTitles(testtools.TestCase): self._check_titles(filename, template_titles, titles) self._check_lines_wrapping(filename, data) self._check_no_cr(filename, data) + self._check_no_zwsp(filename, data) self._check_trailing_spaces(filename, data)

AltStyle によって変換されたページ (->オリジナル) /