mirror of
https://github.com/openshift/community.okd.git
synced 2026-03-26 19:03:14 +00:00
Add ansible-lint to tox linters (#258)
* Add ansible-lint to tox linters * Bump black * Black formatting * fix linting
This commit is contained in:
@@ -295,9 +295,9 @@ class OpenShiftMigrateTemplateInstances(AnsibleOpenshiftModule):
|
||||
object_type in transforms.keys()
|
||||
and obj["ref"].get("apiVersion") != transforms[object_type]
|
||||
):
|
||||
ti_elem["status"]["objects"][i]["ref"][
|
||||
"apiVersion"
|
||||
] = transforms[object_type]
|
||||
ti_elem["status"]["objects"][i]["ref"]["apiVersion"] = (
|
||||
transforms[object_type]
|
||||
)
|
||||
ti_to_be_migrated.append(ti_elem)
|
||||
|
||||
return ti_to_be_migrated
|
||||
|
||||
@@ -225,7 +225,7 @@ def get_oauthaccesstoken_objectname_from_token(token_name):
|
||||
|
||||
sha256Prefix = "sha256~"
|
||||
if token_name.startswith(sha256Prefix):
|
||||
content = token_name[len(sha256Prefix):]
|
||||
content = token_name[len(sha256Prefix) :]
|
||||
else:
|
||||
content = token_name
|
||||
b64encoded = urlsafe_b64encode(hashlib.sha256(content.encode()).digest()).rstrip(
|
||||
|
||||
@@ -421,9 +421,9 @@ class OpenShiftRoute(AnsibleOpenshiftModule):
|
||||
if tls_insecure_policy == "disallow":
|
||||
tls_insecure_policy = None
|
||||
else:
|
||||
tls_ca_cert = (
|
||||
tls_cert
|
||||
) = tls_dest_ca_cert = tls_key = tls_insecure_policy = None
|
||||
tls_ca_cert = tls_cert = tls_dest_ca_cert = tls_key = (
|
||||
tls_insecure_policy
|
||||
) = None
|
||||
|
||||
route = {
|
||||
"apiVersion": "route.openshift.io/v1",
|
||||
|
||||
4
tox.ini
4
tox.ini
@@ -8,7 +8,7 @@ install_command = pip install {opts} {packages}
|
||||
|
||||
[testenv:black]
|
||||
deps =
|
||||
black >= 23.0, < 24.0
|
||||
black >= 25.0, < 26.0
|
||||
|
||||
commands =
|
||||
black {toxinidir}/plugins {toxinidir}/tests
|
||||
@@ -24,10 +24,12 @@ commands =
|
||||
deps =
|
||||
flake8
|
||||
{[testenv:black]deps}
|
||||
{[testenv:ansible-lint]deps}
|
||||
|
||||
commands =
|
||||
black -v --check --diff {toxinidir}/plugins {toxinidir}/tests
|
||||
flake8 {toxinidir}
|
||||
ansible-lint
|
||||
|
||||
[flake8]
|
||||
# E123, E125 skipped as they are invalid PEP-8.
|
||||
|
||||
Reference in New Issue
Block a user