Commit Graph

16 Commits

Author SHA1 Message Date
Akihiro Motoki 90a8302231 Update the documentation link for doc migration
Change-Id: I7db258cc50373c5011b8f99b6f8971a08ca336f3
2017-07-20 15:46:41 +00:00
Jenkins ef45551f6f Merge "Fix rst heading while reading" 2017-06-30 12:47:53 +00:00
Boden R d0c4e06047 remove deprecated N523 hacking check
The N523 hacking check check_oslo_namespace_imports has been removed.
This hacking check has been deprecated and scheduled for removal in Pike
and no consumers directly rely on it today [1][2].

[1] http://codesearch.openstack.org/?q=N523
[2] http://codesearch.openstack.org/?q=check_oslo_namespace_imports

Change-Id: Ie041ddca1c07ca76a32c5974b0de41adf0402102
2017-06-28 13:20:48 -06:00
Cao Xuan Hoang 87efcaac09 Fix rst heading while reading
Change-Id: If21519d7127dcb8200c33ab1b2207d07e9e7b32c
2017-05-29 11:43:49 +07:00
Ihar Hrachyshka b87ecb3b8c Enforce log messages not being translated
This is in line with discussion [1] where translators asked to stop
translating log messages, leaving translations for user visible messages
only.

This patch introduces a new N537 check, and since it is more broad than
N533 while covering all cases of the latter check, N533 is removed.

This patch also cleans up _i18n._L? translation hints since they are
internal and won't be allowed anymore.

[1] http://lists.openstack.org/pipermail/openstack-dev/2017-March/114191.html

Related-Bug: #1674569
Change-Id: I2813587824eac1a996c715b0c4bd36b0c9580d73
2017-04-12 15:57:38 -07:00
Ihar Hrachyshka c4a921ec35 Stop enforcing non-debug log translations
This is in line with discussion [1] where translators asked to stop
translating log messages, leaving translations for user visible messages
only.

This patch kills N531 hacking check. A follow up in one of next library
releases will also kill N533, replacing it with a more broad check
forbidding any log translations, not just debug.

We don't squash existing check removal with the patch that adds new
checks because those checks are mutually exclusive, and so with a
squash, we would make it so that consuming projects would not be able to
adopt their code to the coming changes in a non-breaking way.

[1] http://lists.openstack.org/pipermail/openstack-dev/2017-March/114191.html

Change-Id: I5b92dbda79bd45cd1e2f5329ebc046a2dd9b7bff
2017-03-21 11:45:56 +00:00
Boden R 90008a6f4f Use assertIsNone instead of assertEqual(None, *)
One should replace assertEqual(None, *) with assertIsNone in tests
that validate that a variable is None.

This is based on commit 33a459c2c309670b0fcb2fcac5d128e802be7a69

Change-Id: I7794934f5c2267125bafb9d9953352daa68c39a7
2017-01-15 09:38:59 +00:00
Boden R c61976b66d Use new checks in hacking 0.12
Neutron recently updated their usage of hacking to use
version 0.12 [1] that now contains the hacking check
check_delayed_string_interpolation who's off_by_default
value is initially True (i.e. disabled). This hacking check
is defined in neutron_lib, but hasn't been registered in our
factory and isn't being consumed directly [2].

This patch takes a simple approach to reusing openstack-dev
hacking checks:
- Removes all traces of neutron-lib's version of the check; no one is
using it [2].
- Bumps our version of hacking to use  0.12 so we can use the checks
in that release.
- Enables the check via enabled extensions in tox.ini as neutron did [1].
- Updates our hacking check usage, noting that adopters should
enable the same extensions we do (via tox.ini).

[1] https://review.openstack.org/#/c/394817/
[2] http://codesearch.openstack.org/?q=check_delayed_string_interpolation&i=nope&files=&repos=

Change-Id: Ie9448317855b9cba6092cd0f63b77d26a562a5c9
2016-12-15 07:03:58 -07:00
Takashi NATSUME eb32fd4fbd Add a hacking rule for string interpolation at logging
String interpolation should be delayed to be handled
by the logging code, rather than being done at the point of
the logging call. So add the following hacking rule for it.

- [N536] String interpolation should be delayed at logging calls.

We need this to ensure that all projects using the neutron-lib
hacking rules still have enforcement of the log policies
of the project.

See the oslo i18n guideline.

* http://docs.openstack.org/developer/oslo.i18n/guidelines.html

Change-Id: I901dcbfbd53d5d19db651473d2891bc8e8a59710
Related-Bug: #1596829
2016-08-15 09:53:28 +09:00
Boden R 172918f64d Forbid eventlet hacking check
As per [1] we are not allowing eventlet based code in neutron-lib.
This patch adds a hacking check to ensure no eventlet based imports
are brought into neutron-lib. This check is added to the neutron-lib
internal checks as consumers are not likely to forbid eventlet yet.
UTs are also included.

[1] https://review.openstack.org/#/c/333017/

Change-Id: I4a32093a0971750e07f89fff5a1d5c501cf20cdd
2016-08-03 04:54:08 -06:00
Ihar Hrachyshka 7c09268021 Deprecate N523 check that forbids oslo.* imports
Oslo libraries don't ship oslo.* import namespace for a while, so there
is no real need to check against its usage. Since the module is public,
we need to follow deprecation process.

Note that only direct usage of the check is supported. Factory does not
register it anymore.

Change-Id: I48dc1555fd2c77708fd44f3eed4617f636c346de
2016-07-21 14:30:39 +02:00
Boden R ba717a08ec Localized exception message hacking check
As per [1], this patch adds a new hacking check that verifies
raised exceptions don't use unlocalized string messages. This
patch also adds unit tests for the new check and enables
checks for neutron-lib itself (as per tox.ini).

Note: Perhaps this check better belongs in openstack-dev/hacking
but it seems we already have a number of more generic checks
in neutron. We can discuss that here need be.

NB: Without [1] this new hacking check fails when running pep8 on
neutron-lib.

[1] https://review.openstack.org/#/c/324374/

Change-Id: Ia13f190ec6843ab360d115871d345c4ddc302cc5
2016-06-15 11:02:12 -04:00
Gary Kotton b82347d535 Add translation validations to the hacking policy
3 hacking rules have been migrated from neutron. The rules are:

 [N531] Validate that LOG messages, except debug ones,
        have translations
 [N532] Validate that LOG.warning is used instead of LOG.warn.
        The latter is deprecated.
 [N533] Validate that debug level logs are not translated

We need this to ensure that all projects using the neutron-lib
hacking rules still have enforcement of the log translation
policies of the project.

Change-Id: I3d3c6797805e59304e83b9d1bcbfc449080f823a
2016-06-11 00:23:32 -07:00
Doug Wiegley be3795fd70 Add a hacking check against importing neutron
Partially-Implements: blueprint neutron-lib
Change-Id: I90c563f5b2e7a66bf47930bffbba01100ff0b574
2016-02-08 20:54:20 +00:00
Doug Wiegley 8b92af6f14 Lib specific hacking rules
Starting with the most basic of the neutron rules. The neutron file will
include this one along with its own rules.

Partially-Implements: blueprint neutron-lib
Change-Id: Icda0c959c2ddbd1feada33e326f6c0fb0b23fc6a
2016-02-08 13:53:10 -07:00
Doug Wiegley b0d12660ea Initial cookiecutter commit
Partially-Implements: bp neutron-lib
Change-Id: Ia6884f545efb56429bcb74246a74e95d1318376a
2015-11-20 17:24:43 -07:00