lint: bump flake8

- Use recommended flake8 setup in pre-commit
- Removes use of hacking as pre-commit provides the lock-in
- Bumps flake8 to latest stable
- Resolves two ignored rules

Change-Id: I98f382cd2b72345748e40106624c73039e0f0f2c
This commit is contained in:
Sorin Sbarnea 2020-01-10 13:27:28 +00:00
parent abfe6c9093
commit 01c3637a88
7 changed files with 34 additions and 33 deletions

View File

@ -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:

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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:

View File

@ -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 = _