Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix python warnings #6349

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

hekota
Copy link
Member

@hekota hekota commented Feb 22, 2024

No description provided.

Copy link
Contributor

⚠️ Python code formatter, darker found issues in your code. ⚠️

You can test this locally with the following command:
darker --check --diff -r fdbecd30f80b9538dae8fee1efd48612c5c6a703..1ebf5ec58c47fe43741118d3194c547fae4db46f utils/lit/lit/TestRunner.py
View the diff from darker here.
--- TestRunner.py	2024-02-22 19:20:14.000000 +0000
+++ TestRunner.py	2024-02-22 19:23:03.639532 +0000
@@ -436,15 +436,14 @@
             ('%/t', tmpBase.replace('\\', '/') + '.tmp'),
             ('%/T', tmpDir.replace('\\', '/')),
             ])
 
     # re for %if
-    re_cond_end = re.compile('%{')
-    re_if = re.compile('(.*?)(?:%if)')
-    re_nested_if = re.compile('(.*?)(?:%if|%})')
-    re_else = re.compile('^\\s*%else\\s*(%{)?')
-
+    re_cond_end = re.compile("%{")
+    re_if = re.compile("(.*?)(?:%if)")
+    re_nested_if = re.compile("(.*?)(?:%if|%})")
+    re_else = re.compile("^\\s*%else\\s*(%{)?")
 
     # Collect the test lines from the script.
     script = []
     requires = []
     unsupported = []
@@ -453,17 +452,19 @@
         if command_type == 'RUN':
             # Trim trailing whitespace.
             ln = ln.rstrip()
 
             # Substitute line number expressions
-            ln = re.sub('%\\(line\\)', str(line_number), ln)
+            ln = re.sub("%\\(line\\)", str(line_number), ln)
+
             def replace_line_number(match):
                 if match.group(1) == '+':
                     return str(line_number + int(match.group(2)))
                 if match.group(1) == '-':
                     return str(line_number - int(match.group(2)))
-            ln = re.sub('%\\(line *([\+-]) *(\d+)\\)', replace_line_number, ln)
+
+            ln = re.sub("%\\(line *([\+-]) *(\d+)\\)", replace_line_number, ln)
 
             # Collapse lines with trailing '\\'.
             if script and script[-1][-1] == '\\':
                 script[-1] = script[-1][:-1] + ln
             else:
  • Check this box to apply formatting changes to this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

Successfully merging this pull request may close these issues.

None yet

1 participant