-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: Remove sneaky unicode characters that break a regex and console outputs on Windows #6987
base: main
Are you sure you want to change the base?
Conversation
@@ -337,7 +337,7 @@ def print_console( | |||
|
|||
if not is_quiet: | |||
for file in self.parsing_errors: | |||
output_data += colored(f"Error parsing file {file}ֿ\n", "red") | |||
output_data += colored(f"Error parsing file {file}\n", "red") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line causes problems with outputs, notice a symbol before \n
@@ -488,7 +488,7 @@ def print_reports( | |||
) | |||
|
|||
# Remove colors from the cli output | |||
ansi_escape = re.compile(r'(?:\x1B[@-_]|[\x80-\x9F])[0–9:;<=>?]*[ -/]*[@-~]') | |||
ansi_escape = re.compile(r'(?:\x1B[@-_]|[\x80-\x9F])[0-9:;<=>?]*[ -/]*[@-~]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line makes a wrong regex, notice a wrong dash
@@ -9,7 +9,7 @@ def __init__(self) -> None: | |||
""" | |||
https://kubernetes.io/docs/concepts/configuration/overview/ | |||
|
|||
Don’t specify a hostPort for a Pod unless it is absolutely necessary. | |||
Don't specify a hostPort for a Pod unless it is absolutely necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line was changed by the script I made to go over this repo to find bad unicode characters.
I left it in the PR just because unicode seems unnecessary here. There's no bug in this line.
@@ -54,7 +54,7 @@ def get_scannable_file_paths(root_folder: str | None = None, excluded_paths: lis | |||
return files_list | |||
|
|||
for root, d_names, f_names in os.walk(root_folder): | |||
# Don't walk in to "node_modules" directories under the root folder. If –for some reason– | |||
# Don't walk in to "node_modules" directories under the root folder. If for some reason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line was changed by the script I made to go over this repo to find bad unicode characters.
I left it in the PR just because unicode seems unnecessary here. There's no bug in this line.
@@ -9,7 +9,7 @@ def __init__(self): | |||
""" | |||
https://kubernetes.io/docs/concepts/configuration/overview/ | |||
|
|||
Don’t specify a hostPort for a Pod unless it is absolutely necessary. | |||
Don't specify a hostPort for a Pod unless it is absolutely necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line was changed by the script I made to go over this repo to find bad unicode characters.
I left it in the PR just because unicode seems unnecessary here. There's no bug in this line.
User description
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
There were 2 almost unnoticeable Unicode characters that caused 2 separate problems:
Regex for ANSI escaping contained the wrong dash, making the regex incorrect.
Message about the file parsing errors failed to be displayed when running on a Windows agent on Azure DevOps:
Related: #6416
Checklist:
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Removes an invisible Unicode character (Hebrew Point Rafe) from error messages and comments. Updates regular expression for ANSI escape sequence matching. Improves readability of comments in Kubernetes-related files.
Modified files (2)
Latest Contributors(2)
Modified files (3)
Latest Contributors(2)