Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commithooks.
- Applying fixes for pre-commit compliance in all code.
Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.
pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker
(check-byte-order-marker);
- Checks that non-binary executables have a proper
shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings
(check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)
For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks
Change-Id: Iba1e2ce707051ea393ac559fc51b1f07da1f6ee8
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
Switch to openstackdocstheme 2.2.0 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems
Update Sphinx version as well.
openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.
Depends-On: https://review.opendev.org/728938
Change-Id: I3a57dfef23cee9dc4430f46063e89ffb54d0396c
Some options are now automatically configured by the version 1.20:
- project
- html_last_updated_fmt
- latex_engine
- latex_elements
- version
- release.
Change-Id: Id5c6afef01c6f38cb72c3a6526352db40dcb3a87
Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.
[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045
Change-Id: I7d39be84c5c8bd730119220720d2d33cb9e4ef62
Bandit 1.6.0 accidentally changed how the exclusion list option is
handled and breaks our use of it. Cap to the previous version until
Bandit has fixed the problem.
Sphinx 2.0 no longer works on python 2.7, so we need to start capping
it there as well.
Change-Id: I719a8cff50dcc0dea62db14edf7b9ab35b72facd
Reference: https://github.com/PyCQA/bandit/pull/489
It's a proper name.
Mostly this is just to trigger the release notes jobs again after
they failed on release.
Change-Id: I5ea88dfbad5b9d60d9b404cef4a586e92fb5a957
With pbr 2.0 and Sphinx 1.5, the setting for treat sphinx warnings as
errors is setting warning-is-error in build_sphinx section. Migrate the
setting from the old warnerrors one.
There are two issues:
- The `*` character is recognized as an emphasis character and must be
escaped
- The index references modules that have since been removed
These are resolved.
Change-Id: Id078022c0f75bf8f162b693d260f67116eb6428b
The current doc page for secretutils is blank [1], most likely because
of the way constant_time_compare is in the exception block.
This patch manually tells sphinx to doc the constant_time_compare
function. Also adds the oslo.utils version when the module was added.
[1]: https://docs.openstack.org/developer/oslo.utils/api/secretutils.html
Change-Id: Ic1fb15176c93f126826f568149cabf4b8e5450d8
This function has been shared at least kwapi and all Telemetry projects
including ceilometer, aodh, panko and gnocchi. As a generator, it produces
sequence of keypairs for nested dictionaries. It seems to be good moving it
to the common shared code.
So add an initial dictutils and tests for it.
Change-Id: Ibd7c2ce4ef9c2608910b26169a804eb463759c7f
This code (or a version of it) is being shared by at least nova
and keystonemiddleware and it seems like a good idea to move it
to being common shared code (especially due to the importance
of getting this code correct).
This adds an initial secretutils and adds tests for it.
Change-Id: Ia603202a065d5b345608e712f63f7af21fd74dea
We added these two modules recently, but didn't include them in doc
index. This commit add them in doc index and add version information
about when they were added.
Change-Id: Ic3347f57a722187fc4bfe68fce6f08fba97af7fb
Document in which version new types and functions were added using
".. versionadded:: x.y". Document changes using
".. versionchanged:: x.y."
For new modules, add the versionadded tag in the module top
docstring, not on each type/function.
Add fileutils to documentation. The doc part was forgotten during the
graduation.
Add docstrings to convert versions of versionutils.
I used "git blame" + "git tag --contains=SHA1" to find these version,
and then I checked manually each version.
Change-Id: Ia2f00aa29eb36410a49fc1d350896a569a7737a1
People typically want to know if this can be used as a
context manager (it can); so make sure that the generated
docs explicitly shows them (vs not showing them, which is
the default).
Change-Id: I97d512afc79581478a5b7e734108c38635b79f45
This seems to better match what the other oslo
libraries are calling this section, so we might as
well call it that to.
Change-Id: Ib90d1e0bb2c90776c81a2b272f9aeb5c3565bfc6
These do not seem to have been created and
made appear, so make them appear and make sure
the exposed public API(s) have docstrings so
that they appear in the generated docs.
Change-Id: Ie34e46647b0b20d936ddaa15dc824d0e2d2ca99d
Also makes the docs look more like the other
oslo libraries so that the content is easily readable
across projects.
Change-Id: I85158a89f103cdef2afa268558592c46ce6c3411
When greenthreads are being used (and/or eventlet is available and
some modules have been monkey-patched) emit warnings to the users
that certain modules should be monkey-patched and if they are not
then spurious or unexpected lock-ups and/or hangs may result due to
this type of mixed usage which doesn't typically end well.
This commit adds that functionality to a new eventlet utils module
that can be used by calling code when that code really knows it will
not work without modules being patched or partially being patched.
Change-Id: I9a856fc0a6502b438c8da9b2f589154a6fa89a9f
There was no fixture for using the functions related to
timeutils.set_time_override. A fixture is handy because
clear_time_override must be done for cleanup.
Change-Id: Ifef8d9f20fa9e5aa96ebf5040f290f65b503f0bd
Move the public API out of oslo.utils to oslo_utils. Retain the ability
to import from the old namespace package for backwards compatibility for
this release cycle.
bp/drop-namespace-packages
Change-Id: Ic6dd62097399bf75e3d11b4d8a6400971069c415
Add auto-generated documentation for the public modules in the library
and clean up a bit of the docstrings used.
Change-Id: Id5efa5c413b82e13f1a7ac78c92e39c193f12214