diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ecfbf6bb0..1ddd18d3f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,5 @@ --- +# to bump run: pre-commit autoupdate repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.4.0 @@ -9,11 +10,12 @@ repos: - id: check-executables-have-shebangs - id: check-merge-conflict - id: debug-statements - - id: flake8 - additional_dependencies: - - hacking<1.2.0,>=1.1.0 - id: check-yaml files: .*\.(yaml|yml)$ + - repo: https://github.com/PyCQA/flake8.git + rev: 3.7.9 + hooks: + - id: flake8 - repo: https://github.com/adrienverge/yamllint.git rev: v1.20.0 hooks: diff --git a/ci-scripts/validate_jinja2.py b/ci-scripts/validate_jinja2.py index 5706a8e39..83537f013 100644 --- a/ci-scripts/validate_jinja2.py +++ b/ci-scripts/validate_jinja2.py @@ -15,18 +15,19 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. -DOCUMENTATION = ''' ---- -python script to read and parse jinja2 templates ---- -''' - from jinja2 import Environment from jinja2 import exceptions import os import sys + +DOCUMENTATION = ''' +--- +python script to read and parse jinja2 templates +--- +''' + # Jinja Environment env = Environment() diff --git a/roles/build-test-packages/library/jenkins_deps.py b/roles/build-test-packages/library/jenkins_deps.py index e9073862f..9287703ce 100755 --- a/roles/build-test-packages/library/jenkins_deps.py +++ b/roles/build-test-packages/library/jenkins_deps.py @@ -11,6 +11,13 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. +# see http://docs.ansible.com/developing_modules.html#common-module-boilerplate +import json +import logging +import re +import requests +from ansible.module_utils.basic import * + DOCUMENTATION = ''' --- @@ -49,11 +56,6 @@ EXAMPLES = ''' patchset_rev: d18f21853e2f3be7382a20d0f42232ff3a78b348 ''' -import json -import logging -import re -import requests - # we ignore any other host reference ALLOWED_HOSTS = ['review.opendev.org', 'review.gerrithub.io', @@ -223,8 +225,5 @@ def main(): module.exit_json(**result) -# see http://docs.ansible.com/developing_modules.html#common-module-boilerplate -from ansible.module_utils.basic import * - if __name__ == "__main__": main() diff --git a/roles/build-test-packages/library/zuul_deps.py b/roles/build-test-packages/library/zuul_deps.py index b15319fbf..7a8cf25f0 100755 --- a/roles/build-test-packages/library/zuul_deps.py +++ b/roles/build-test-packages/library/zuul_deps.py @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# see http://docs.ansible.com/developing_modules.html#common-module-boilerplate +from ansible.module_utils.basic import * + DOCUMENTATION = ''' --- module: zuul_deps @@ -76,8 +79,5 @@ def main(): module.exit_json(**result) -# see http://docs.ansible.com/developing_modules.html#common-module-boilerplate -from ansible.module_utils.basic import * - if __name__ == "__main__": main() diff --git a/roles/gate-quickstart/library/jenkins_deps.py b/roles/gate-quickstart/library/jenkins_deps.py index cff00fd70..c178fee12 100644 --- a/roles/gate-quickstart/library/jenkins_deps.py +++ b/roles/gate-quickstart/library/jenkins_deps.py @@ -11,6 +11,13 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. +import json +import logging +import re +import requests +# see http://docs.ansible.com/developing_modules.html#common-module-boilerplate +from ansible.module_utils.basic import * + DOCUMENTATION = ''' --- @@ -49,11 +56,6 @@ EXAMPLES = ''' patchset_rev: d18f21853e2f3be7382a20d0f42232ff3a78b348 ''' -import json -import logging -import re -import requests - # we ignore any other host reference ALLOWED_HOSTS = ['review.opendev.org', 'review.gerrithub.io', @@ -217,8 +219,5 @@ def main(): module.exit_json(**result) -# see http://docs.ansible.com/developing_modules.html#common-module-boilerplate -from ansible.module_utils.basic import * - if __name__ == "__main__": main() diff --git a/roles/overcloud-ssl/library/tls_tht.py b/roles/overcloud-ssl/library/tls_tht.py index 1b9ca9048..c08e2b820 100644 --- a/roles/overcloud-ssl/library/tls_tht.py +++ b/roles/overcloud-ssl/library/tls_tht.py @@ -15,6 +15,9 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. +import yaml +from ansible.module_utils.basic import * + DOCUMENTATION = ''' --- @@ -63,9 +66,6 @@ EXAMPLES = ''' - tls_tht: ''' -import yaml -from ansible.module_utils.basic import * # noqa - def _open_yaml(filename): with open(filename, "r") as stream: diff --git a/setup.cfg b/setup.cfg index 9278fd116..cc31d81a7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = tripleo-quickstart-extras -summary = Extend tripleo-quickstart's abilities to deploy and test TripleO +summary = "Extend tripleo-quickstart's abilities to deploy and test TripleO" description-file = README.rst author = OpenStack @@ -46,5 +46,5 @@ skip_changelog = True # H301 one import per line # F405 ... may be undefined, or defined from star imports: show-source = True -ignore = E123,E125,E402,E501,F403,H303,H301,F405 +ignore = E123,E125,E501,F403,H303,F405 builtins = _