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: I65a40bbff17d92b959764846801d5e0ddd3b97ce
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
While we're here, specifying the doctree directory and configuring use
of saved environments doesn't really make sense when we blast all
previous doc build artefacts away on each build, so stop specifying
those.
Change-Id: I2b04a5c0ac121954aed91ae133e249a2e5813ee0
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Update the minversion parameter to use the python -m pip to install
python packages:
https://tox.readthedocs.io/en/latest/changelog.html#id185
Also Inherit the jobs requirements to simplify maintainance.
Change-Id: I730f15a4872334f040d5bd03da37e7c4f9e8148b
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: Ied9f46640cf2f338a5784e1c72998f93b5c860c5
1. Clean up the unnecessary sphinx from test-requirements.txt
2. when run `tox -e docs` in localhost, some files will be
created, it not belong to the code, shoule be ignore by the git
Change-Id: I2bae30fedfdc64fbbafbe0e96794597b564c2d54
As noted in I1678bcd26b41fdf09f98c36fc095d6d4c1826deb (for pbr), we need
to pass some flags [1] to stestr to ensure stdout is captured in
additional to any logs.
We also make it easier to override this capturing and remove some errant
whitespace.
[1] https://github.com/mtreinish/stestr/commit/1316ebd7
Change-Id: I5d98c2b8e31b4eb4741dfa5055a5628140b1add5
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
os-testr has moved over to use stestr instead of testr. While this
is usually compaible with existing settings, there is a warning
that is emitted when .stestr.conf is not present. It is usually
able to fall back to parsing the .testr.conf file, but to be more
correct and to prevent future problems we should update the config.
Change-Id: I929f75d069f20b8cfa8af4e0712883e91a54dc4f
This was introduced in change I87b30273. While we're here, we also start
passing positional arguments to 'sphinx-build' so we can configure it
somewhat dynamically.
Change-Id: I766da57377cd2ddb0a82419e36eeec1046309948
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
Change-Id: I4b329f3233ce126fb25bff6c947aa8379b991d59
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Set the default python to python3 except for the py27 environment. We
have to set that explicitly to override the new default.
Change-Id: Ief7f053de13287bc3c1032870c255be4b880d172
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
pep8 under python 3 is more strict than under python 2, so to make
sure our projects meet the more strict standards we want to run the
pep8 jobs using python 3 by default.
Change-Id: If3016aef3a75281ff9edb5615bbc4575e6214e9e
'pip install -U' ugrades specified packages, this is not necessary
since we use constraints, remove the parameter '-U' from the line.
With tools/tox_install.sh - which a previous change of mine removed -
the -U was not harmful, but with the current set up, it might cause
upgrades, so remove it.
Change-Id: I400b848c79955a8fcb08cdd46e043660df67589c
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: I7a266b2209097ff2db0e43076c0e8621cfece5f1
Some of the available checks are disabled by default, like:
[H106] Don’t put vim configuration in source files
[H203] Use assertIs(Not)None to check for None
Change-Id: I0a99014f983c24a8d36533e36cf56ed8d7a74c5c
Now that there exists only a gate job for Python 3.5 and not 3.4,
we should remove those references to the 3.4 that is untested.
Change-Id: Iacd8ea7388a8e7c0c28b184a4b823a95aa04b987
Adding constraints support to libraries is slightly more complex than
services as the libraries themselves are listed in upper-constraints.txt
which leads to errors that you can't install a specific version and a
constrained version.
This change adds constraints support by also adding a helper script to
edit the constraints to remove oslo.config.
Change-Id: I98622a0d783aa759e73df4e594afe409ad141bab
Now that there is a passing gate job, we can claim support for
Python 3.5 in the classifier. This patch also adds the convenience
py35 venv.
Change-Id: I688d8d5ded43878cc3330d67c7749c208d821767
Now that the bandit linter runs without a bandit.yaml specified,
it should exclude the tests directory similar to how it did before
in the bandit.yaml.
The reason this has not caused a problem yet is because bandit is
still finding a config bandit.yaml in .tox/pep8/etc/bandit/bandit.yaml.
But in a newer version of bandit this will not be the case.
Change-Id: I66dc7c2b826cf6e061fc6abc368c2be00ab2d202
Run security linter bandit as part of pep8. Pep8
is the usual linter target and thus let's use it there instead of
starting another short-running job to enable it.
This copy the idea from I54a4fccebb375517f9cd129f62f8f0c795b6edcc
Change-Id: I4dc181ec30fd632043619e4a34093772de23eb2a
The release management team have indicated this is their preferred way
to collect release notes in future.
Change-Id: Icab591ed1b12c1fd84c15f7b4a5d1d56d1d7588a