This patch adds a doc8 check of .rst files to the current pep8 check.
It includes fixes to the .rst files that didn't pass the check.
Co-authored-By: Hoang Trung Hieu <hieuht@vn.fujitsu.com>
Change-Id: I5a9299200202576d97760ebf07bceb930888f2d7
Translations team has stopped translating the logs. We need to
stop enforcing the usage of translation functions on logging.
Change-Id: I56900846ce8ea92eaa3873f64b383a36a4974908
Add hacking checks to check dict.iteritems, dict.itervalues
and dict.iterkeys should not be used in the future and
raise error while running pep8 using tox.
Trivial Fix
Change-Id: Id7f0c8b963cfd5739ed3e2ecec2c0feebc290af4
xrange() does not exist in python3.
Add hacking check rule so that codes with xragne() never pass test.
Change-Id: I40f6d9aab3ef334da46bd460eb6a4ed3948e951e
PEP-0274 introduced dict comprehensions to replace dict constructor
with a sequence of key-pairs[1], these are two benefits:
- First, it makes the code look neater.
- Second, it gains a micro-optimization.
Glance dropped python 2.6 support in Kilo, we can leverage this now.
Note: This commit doesn't handle dict constructor with kwargs.
This commit also adds a hacking rule.
[1]http://legacy.python.org/dev/peps/pep-0274/
Co-Authored-By: ChangBo Guo(gcb) <eric.guo@easystack.cn>
Co-Authored-By: Kamil Rykowski <kamil.rykowski@intel.com>
Change-Id: I0ba408f9c616dcdb09618f6256db76b9facc0c1d
The contextlib.nested call has been deprecated
in Python 2.7. This causes DeprecationWarning
messages in the unit tests.
There are also known issues with contextlib.nested
that were addressed by the native support for
multiple "with" variables. For instance, if the
first object is created but the second one throws
an exception, the first object's __exit__ is never
called. For more information see
https://docs.python.org/2/library/contextlib.html#contextlib.nested
contextlib.nested is also not compatible in Python 3.
Since Glance no longer supports 2.6 we can remove
the use of these contextlib.nested calls.
Added hacking check to catch if any new instances
are added to the codebase.
Closes-Bug: #1428424
Change-Id: Ic8edfa41d6c468cf6db8d11d3533e4f8cf2053c2
oslo.i18n uses different marker functions to separate the
translatable messages into different catalogs, which the translation
teams can prioritize translating. For details, please refer to:
http://docs.openstack.org/developer/oslo.i18n/guidelines.html#guidelines-for-use-in-openstack
Added hacking rules for warning, info, critical, error and exception
about checking translation for log messages and fixed for below cases only,
1. LOG.error(_(""))
2. LOG.info(_(""))
3. LOG.exception(_(""))
4. LOG.critical(_(""))
5. LOG.warning(_(""))
Below scenario is not handled in this patch,
If message is passed to LOG call using separate variable,
ex.
msg = (_("")
LOG.error(msg)
Change-Id: Idbf8779cdfc41ca1424bebcd101096bec482872f
For python 3 compatibility, this adds a hacking check to prevent the
usage of unicode().
Change-Id: I791bbf251ac0f9615a9bedc2dd295a7982d72e0a
Closes-bug: #1282893
There have been a handful of changes recently to fix stylistic bugs
in the unit tests (example: If41a7). The changes themselves were fine,
but there are two problems:
1) The stylistic changes they made were not listed in HACKING.rst
2) They were one-time changes; the rules that were violated will
continue to be violated.
This change updates HACKING.rst to include a few of the stylistic
rules that have been fixed recently, and adds checks to ensure that
they will be enforced going forward. This is based on nova's hacking
checks.
Change-Id: Ic115342605c472f3a5d255aa570ecb60175ca087
According to the OpenStack translation policy available at
https://wiki.openstack.org/wiki/LoggingStandards debug messages
should not be translated. Like mentioned in several changes in
Nova by garyk this is to help prioritize log translation.
This patch adds a new hacking check - N319 - that ensures all
debug log messages don't have translations.
Change-Id: I9dd958b904671a7eb95883026e14684469dc52d5
Closes-Bug: #1317847
Reference the OpenStack hacking guide in HACKING.rst and remove
duplicate entries. Adds placeholder section for glance specific
rules.
Change-Id: I1bfff8c69c9370e2d648197b7e71e229695ef627
Use LOG for variable name and __name__ for logger name. Also
document this fact in HACKING.rst
Fixes bug 1015685
Change-Id: I0d9d80bef66197a28ed3d650f17859202048d776
* Adds HACKING.rst -- with some modifications that do not apply
to Glance
* Renames README to README.rst
* Remove old cruft with rfc.sh and BZR stuff
Change-Id: I1ff640fcee71e4d9bafa28ddd83c779ac4d702d2