Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- 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: I60e74ffcc7a4cc5bb80b19c3aae1b317442d93bd
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
This patch bumps bandit allowed version to >=1.6.0,<1.7.0 in order to
avoid the errors detailed here https://github.com/PyCQA/bandit/pull/393
Change-Id: I005962a63341bb8585141dfe5dcff3ea79560b87
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
The repo is Python 3 now, so update hacking to version 3.1.0 which
supports Python 3.
Fix problems found.
Remove hacking and friends from lower-constraints, they are not needed
for installation.
Change-Id: I810e4c30513746bc46a3e65b398539929a7ac6b0
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: I26f2df6d4657133a5c7e6ed85298aa843c1bdd73
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This allows us to use a new version of flake8 that supports Python
3-only syntax. Existing issues are resolved.
Change-Id: I5de7e5cde6a5260f4e7e57586952256b59d3756d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Bandit 1.6.0 accidentally changed how the exclusion list option is
handled and breaks our use of it. Since we generally cap linters
and only move them forward when we're ready to deal with the fallout,
cap Bandit to the previous version until we have a reason to move to
a newer version.
Sphinx 2.0 no longer works on python 2.7, so we need to start capping
it there as well.
The jsonschema cap was removed in g-r so we need to remove it here too.
Change-Id: Ie8f45e4130297b50a8e98031f3f01244e646bec7
According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.
[1] https://etherpad.openstack.org/p/YVR-python-pti
Change-Id: I5c4d37afdc438cc978bff37e4d0c56c7ad60fb19
We do not need tox_install.sh, pip can handle constraints itself
and install the project correctly. Thus update tox.ini and remove
the now obsolete tools/tox_install.sh file.
This follows https://review.openstack.org/#/c/508061 to remove
tools/tox_install.sh.
Change-Id: Ie2bf2618c8e202653a45cde195bd395ab7058dc1
Since pbr already landed and the old version of hacking seems not
work very well with pbr>=2, we should update it to match global
requirement.
Partial-Bug: #1668848
Change-Id: I1af28a757450789f0f523847831b42e016f785fd
The release management team have indicated this is their preferred way
to collect release notes in future.
Closes-Bug: #1634356
Change-Id: Iac926d87064af92ea7e2e8eb24c72effca2641bc
This implements the get_schema() method of the following FieldType:
Object, IPV6Address, NonNegativeInteger, NonNegativeFloat,
IPV4AndV6Address, Dict(fixed from last patch)
implements bp json-schema-for-versioned-object
Change-Id: I6bce3ba7bb32ed2dd8ed6e7f313411bbfef5eff0
A number of configuration errors prevent the successful creation of code
coverage. This corrects the .coveragerc source/omit setup and the tox
package name generation.
Change-Id: Ie55159304b8633acd6b06ba94d0cb8507a337504
Update the version of hacking to the one released for kilo, and fix
issues with code formatting that cause the new hacking checks to fail.
Change-Id: I4c9906df3e71f33b5a13e1f68584d445d79daceb
This renamed the "checks" module to be in line with other oslo libraries,
and adds fixtures and mock to the list of requirements, since they are
required for actual library code.
Change-Id: I782762d5cd4166893593e172f49fda8ab35e478d