WIP Create a zuul for black style

Create a format check

Test Plan
TODO - SUCCESS on black zuul

Closes-bug: #####

Change-Id: I5d7b537e83931304ffd5f67ce51e8ebb44f7e65b
Signed-off-by: Hugo Brito <hugo.brito@windriver.com>
This commit is contained in:
Hugo Brito 2024-03-01 17:38:15 -03:00
parent 8405f3b47c
commit 3920977a97
3 changed files with 26 additions and 1 deletions

View File

@ -10,12 +10,14 @@
- stx-distcloud-client-tox-pep8
- stx-distcloud-client-tox-py39
- stx-distcloud-client-tox-pylint
- stx-distcloud-client-tox-black
gate:
jobs:
- openstack-tox-linters
- stx-distcloud-client-tox-pep8
- stx-distcloud-client-tox-py39
- stx-distcloud-client-tox-pylint
- stx-distcloud-client-tox-black
post:
jobs:
- stx-distcloud-client-upload-git-mirror
@ -50,6 +52,16 @@
tox_envlist: pep8
tox_extra_args: -c distributedcloud-client/tox.ini
- job:
name: stx-distcloud-client-tox-black
parent: tox
description: Run black linting tests.
voting: false
vars:
python_version: 3.9
tox_envlist: black_check
tox_extra_args: -c distributedcloud-client/tox.ini
- job:
name: stx-distcloud-client-upload-git-mirror
parent: upload-git-mirror

View File

@ -23,7 +23,8 @@ import logging
import os
import sys
from cliff import app, commandmanager
from cliff import app
from cliff import commandmanager
from cliff import help as cliff_help
from osc_lib.command import command

View File

@ -51,6 +51,18 @@ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
commands =
pylint {posargs} dcmanagerclient --rcfile=./.pylintrc
[testenv:black]
install_command = pip install {opts} {packages}
deps = black>=23.11.0 # MIT
commands =
black -t py39 --line-length 85 py36 .
[testenv:black_check]
install_command = pip install {opts} {packages}
deps = black>=23.11.0 # MIT
commands =
black -t py39 --line-length 85 --check .
[testenv:cover]
setenv =
PYTHON=coverage run --parallel-mode