Remove run_black.py script

Remove the run_black.py script since all modules applied
the black format. Now the check directly executed by the
black command in tox config. Additionally, update
git-blame-ignore-revs with dcmanager's format commits.

Test Plan:
PASS - Success tox command
PASS - Success zuul jobs

Story: 2011149
Task: 50485

Change-Id: I464b58c331a8f0a42112479f07123bf01370e59c
Signed-off-by: Hugo Brito <hugo.brito@windriver.com>
This commit is contained in:
Hugo Brito 2024-06-29 16:43:47 -03:00 committed by Hugo Nicodemos
parent 8c54af45cc
commit 611ce70662
3 changed files with 8 additions and 46 deletions

View File

@ -33,3 +33,10 @@ fb82532bbf0c91fbd6ba385b0cbab880ec1159d6
51bee5a605ebb016b7905b243ac9d3da86551df6
51b6e19a2cf572399dc394ff3336c3c384de010a
70fd84b263fef57d9589683ce22496b4cb55d65c
9aa90f102eab078a7b9623b9231909cd32490760
7a8694fab160e0eb95acd66c8f519bfebc04900f
591956c86a9a6458fb9b4ab7224d8f29824fd819
9c91fffa072794c45347b678c5daebbb6cf49bd3
30df79b36a07d5d11f9fb84c6635ccccd00755b0
2967ee254c9e3548a96874e62c27abae8557ceba
8c27f069dd06af9aad3327b6a90f2ea29452cd6e

View File

@ -1,41 +0,0 @@
# noqa: H102
import subprocess
import sys
# List of module directories to check
modules = [
"dccommon",
"dcdbsync",
"dcagent",
"dcorch",
"dcmanager",
]
# List of modules that are already formatted with black
formatted_modules = [
"dccommon",
"dcdbsync",
"dcagent",
"dcorch",
"dcmanager",
]
# Function to run black check
def run_black_check(module):
try:
subprocess.run(
["black", "--check", "--diff", "--quiet", f"./{module}"], check=True
)
print(f"Black check passed for {module}")
except subprocess.CalledProcessError as e:
print(f"Black check failed for {module}")
# If the module is in formatted_modules, stx-distcloud-tox-black will fail
if module in formatted_modules:
sys.exit(e.returncode)
# Iterate over modules and run black check
for module in modules:
run_black_check(module)

View File

@ -97,9 +97,5 @@ commands =
# To apply the format in a specific file, use the following command: black <file_path>
deps =
black>=23.11.0 # MIT
# Note: After all files being formatted by Black, the following command should be used
# as default for the black environment and run_black.py script should be deleted.
; commands =
; black --check --diff .
commands =
python run_black.py
black --check --diff .