Skip to content

Commit 3d9d8d5

Browse files
committed
ciq_helper.py: Ruff formatting
This was done automatically by ruff format. Default configuration is used. Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
1 parent 4eb5cbe commit 3d9d8d5

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ repos:
1111

1212
exclude: |
1313
(?x)^(
14-
ciq_helpers.py |
1514
jira_pr_check.py |
1615
release_config.py |
1716
rolling-release-update.py |

ciq_helpers.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33

44
# CIQ Kernel Tools function library
55

6-
import git
76
import os
87
import re
98
import subprocess
109

10+
import git
11+
1112

1213
def process_full_commit_message(commit):
1314
"""Process the full git commit message specific to the CIQ Kernel Tools.
@@ -84,9 +85,7 @@ def get_backport_commit_data(repo, branch, common_ancestor, allow_duplicates=Fal
8485

8586
for line in lines:
8687
if len(commit) > 0 and line.startswith(b"commit "):
87-
upstream_commit, cves, tickets, upstream_subject, repo_commit = (
88-
process_full_commit_message(commit)
89-
)
88+
upstream_commit, cves, tickets, upstream_subject, repo_commit = process_full_commit_message(commit)
9089
if upstream_commit in upstream_commits:
9190
print(f"WARNING: {upstream_commit} already in upstream_commits")
9291
if not allow_duplicates:
@@ -104,9 +103,7 @@ def get_backport_commit_data(repo, branch, common_ancestor, allow_duplicates=Fal
104103
return upstream_commits, True
105104

106105

107-
def CIQ_cherry_pick_commit_standardization(
108-
lines, commit, tags=None, jira="", optional_msg=""
109-
):
106+
def CIQ_cherry_pick_commit_standardization(lines, commit, tags=None, jira="", optional_msg=""):
110107
"""Standardize CIQ the cherry-pick commit message.
111108
Parameters:
112109
lines: Original SHAS commit message.
@@ -159,13 +156,17 @@ def CIQ_original_commit_author_to_tag_string(repo_path, sha):
159156
160157
Return: String for Tag
161158
"""
162-
git_auth_res = subprocess.run(['git', 'show', '--pretty="%aN <%aE>"', '--no-patch', sha], stderr=subprocess.PIPE,
163-
stdout=subprocess.PIPE, cwd=repo_path)
159+
git_auth_res = subprocess.run(
160+
["git", "show", '--pretty="%aN <%aE>"', "--no-patch", sha],
161+
stderr=subprocess.PIPE,
162+
stdout=subprocess.PIPE,
163+
cwd=repo_path,
164+
)
164165
if git_auth_res.returncode != 0:
165166
print(f"[FAILED] git show --pretty='%aN <%aE>' --no-patch {sha}")
166167
print(f"[FAILED][STDERR:{git_auth_res.returncode}] {git_auth_res.stderr.decode('utf-8')}")
167168
return None
168-
return "commit-author " + git_auth_res.stdout.decode('utf-8').replace('\"', '').strip()
169+
return "commit-author " + git_auth_res.stdout.decode("utf-8").replace('"', "").strip()
169170

170171

171172
def repo_init(repo):

0 commit comments

Comments
 (0)