We also remove these unnecessary linter dependencies from
test-requirements.txt.
The independent bandit target was removed because it's integrated to
the pep8 target.
Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
Change-Id: I094897e6de223753a5a497ec42348e4449132b17
hacking 3.0.x is too old.
Also, fixtures appears in both requirements and test-requirements.
Because this library is only used in oslo_service.fixtures for testing,
we can remove it from runtime requirements.
Change-Id: Iaf57598a73af62e07e890245dc51c9af6a807bd7
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: Ib18f38dbec90c62e870307bf22a8b4f193237bce
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: I44b8f01489e503df0813ecac32639dc96c8a1c98
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
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: Ic18f03681c14131217e3025e2cb0cca46ada84ee
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Remove hacking and friends from lower-constraints, they are not needed
for installation.
Change-Id: I0564dc6c961a55387a430f095ed83b392a81c119
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 marking
it there as well.
Co-Authored-By: Hervé Beraud <hberaud@redhat.com>
Co-Authored-By: Ben Nemec <openstack@nemebean.com>
Reference:
https://github.com/PyCQA/bandit/pull/489
Related to Ibaa10b092b262e49435d35f093906bb75dc9762f
Change-Id: Ie3dd6c91c733b85c233213a1c6343009d5f34766
With the upgrade to oslotest 3.6.0 [0], testr no longer works [1].
This is because oslotest no longer requires testr and we don't depend
on it directly in oslo.service. Let's switch to using stestr, too!
Everyone's doing it...
This patch follows [2] in oslo.policy
[0] d5a3c58f71
[1] 897823fbd6
[2] https://review.openstack.org/#/c/579295/
Change-Id: Ia82a17fe26b41730c8c323819591523d66a8cb36
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: Ia99ace49991a7bced6169f024e32832f1b190588
Bandit is a tool designed to find common security issues in
Python code. This change adds a bandit target to tox.ini.
The config file bandit.yaml was generated using bandit-config-generator
Run bandit:
tox -e bandit
Change-Id: I3bd64e1e58d4dc460ce869c50818e9913fe1b9b8
This change modifies WSGI Server to allow creating Unix sockets
along with ip sockets. This would allow consuming projects to use
wsgi.Server to start Unix domain WSGI servers too, and thus get
rid of duplicating code.
Change-Id: I3de23efcd661b95cce6bbd1aa2c94abf0c814dbe
Fixes a bunch of long lines and ensures that doc8
will not complain about any future issues by adding it
to the commands performed during running the py27 tox
environment.
Change-Id: I9ae2f2a05a408dbfe105bf38ea0ae235701fbe0e
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: I966bf06550c20d6977fff659264a5a7d021b260f