Commit Graph

10 Commits

Author SHA1 Message Date
Takashi Kajinami 4f4c2772da Bump hacking (again)
The previous attempt did not update the version in pre commit config
so the old version is still used by pep8 target.

Change-Id: Idf8c7d99f7c6aeb0244d58e85524ba1f039195d8
2024-01-26 01:10:57 +09:00
Andreas Jaeger e44c988306 Remove six usage
Remove six, the python 2/3 compatibility library. It's not needed
anymore since the repo is python3 only.

Remove a now unneeded hacking test.

Change-Id: I40522c4accb4aaf8115d11fee8b081e2d991cb4d
2020-05-11 10:21:58 +02:00
Andreas Jaeger 7f638bb493 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Update local hacking check for new flake8 version.

Blacklist:
W504 line break after binary operator

Fix:
E741 ambiguous variable name
E117 over-indented
E305 expected 2 blank lines after class or function definition, found 1
F841 local variable 'e' is assigned to but never used
W605 invalid escape sequence '\.'

Change-Id: I99d574ca6569f1f177d2c5ce1011f269f4343619
2020-03-30 13:49:29 +00:00
Hervé Beraud 4f385720d7 Remove log translation and i18n
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.

Change-Id: I9ddb6595fc52e46ed8844e39d2fa71029c90b65c
Closes-Bug: #1674567
2019-04-24 11:55:38 +02:00
ZhijunWei cb902e5aff Update hacking version
update the hacking to latest, duo to[1]

[1]: https://github.com/openstack/oslo.messaging/blob/master/HACKING.rst

Change-Id: I1ee7387272690f0de0d7b1937d7c2b0ee404063c
2019-01-21 19:45:42 -05:00
ChangBo Guo(gcb) 4f229832c0 Test:Use unittest.mock on Python 3
The mock module has been added to Python 3.3 as unittest.mock.
The third party mock module doesn't seem to be maintained anymore.
This is follow up of 72c501454e and
add hacking rule to avoid regression issue.

oslotest prepares mock for six in oslotest/__init__.py as follow:
six.add_move(six.MovedModule('mock', 'mock', 'unittest.mock')) and
oslo_messaging/tests/__init__.py imports oslotest before importing
test submodules to setup six.moves for mock, then "from six.moves
import mock" works well.

Note: unittest.mock also detects wrong usage of method
assert_called_once_with.

Change-Id: I3d09733789cfa2550cf47c24f2553357d36bcc0d
2017-02-08 19:15:17 +08:00
Davanum Srinivas cb7bbaefcb Update CheckForLoggingIssues hacking rule from keystone
Fixes problem running flake8 with python3

Change-Id: Id630cb32dc5fe29774ae9e0d2766535906f605bf
2016-03-23 06:28:30 -04:00
ChangBo Guo(gcb) 2d2f6ca5d2 Python 3 deprecated the logger.warn method in favor of warning
Python 3 deprecated the logger.warn method, please see:
https://docs.python.org/3/library/logging.html#logging.warning,
so we prefer to use warning to avoid DeprecationWarning.

Change-Id: I55148140bb2e85039356726057ae1d552e69b663
2016-01-21 13:23:29 +08:00
Davanum Srinivas 588d795b3c Use proper translating helper for logging
Add hacking rule borrowed from keystone to make sure
we don't regress and fix all the issues found by the
hacking check.

Change-Id: I41635fdd83c3e04d04f9849a72c49ccb5ac42875
2015-08-20 21:01:59 -04:00
Doug Hellmann 857ccabc9c Drop use of 'oslo' namespace package
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names. It also adds a local
hacking check to prevent regressions, while disabling style checks in
the "tests" directory, which will be deleted in a subsequent patch.

The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.

Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.

Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages

Change-Id: Iad2ae13c771c99861ca9493c6ab10edcfbd8684a
2015-07-13 21:12:35 +00:00