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

Escape all strings in re.compile (bugfix) #1311

Merged
merged 2 commits into from
Jul 18, 2024
Merged

Conversation

Hook25
Copy link
Collaborator

@Hook25 Hook25 commented Jun 24, 2024

Description

Avoid all the syntax warning that could soon become errors.

Resolved issues

Documentation

Tests

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

Attention: Patch coverage is 35.00000% with 13 lines in your changes missing coverage. Please review.

Project coverage is 44.18%. Comparing base (1d1f06a) to head (d07fdd1).
Report is 146 commits behind head on main.

Files with missing lines Patch % Lines
providers/base/bin/graphics_stress_test.py 0.00% 3 Missing ⚠️
providers/base/bin/ipmi_test.py 0.00% 3 Missing ⚠️
providers/base/bin/pm_log_check.py 0.00% 3 Missing ⚠️
...kbox-support/checkbox_support/scripts/fwts_test.py 0.00% 1 Missing ⚠️
providers/base/bin/battery_test.py 0.00% 1 Missing ⚠️
providers/base/bin/frequency_governors_test.py 0.00% 1 Missing ⚠️
providers/base/bin/network.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1311   +/-   ##
=======================================
  Coverage   44.18%   44.18%           
=======================================
  Files         359      359           
  Lines       38813    38813           
  Branches     6581     6581           
=======================================
  Hits        17148    17148           
  Misses      21003    21003           
  Partials      662      662           
Flag Coverage Δ
checkbox-support 52.56% <85.71%> (ø)
provider-base 18.57% <0.00%> (ø)
provider-resource 32.01% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fernando79513
Copy link
Collaborator

fernando79513 commented Jun 25, 2024

Some other regex compile that are not using the r:

index_regex = re.compile("(?<=Sink Input #)[0-9]*")
muted_regex = re.compile("(?<=Mute: ).*")
name_regex = re.compile("(?<=Name:).*")
channel_map_regex = re.compile("(?<=Channel Map: ).*")

regex = re.compile("Section User")
(just a string)
time_re = re.compile("(?<=time=)[0-9]*")

is_executing_line = re.compile("Executing: '(?P<command>.*)'...$").search
is_output_line = re.compile("Output:$").search
is_field_line = re.compile(
"^- (?P<field>returncode|stdout|stderr):$"
).match
is_test_complete_line = re.compile("test complete$").search
rootdir_pattern = re.compile("^.*?/devices")

All the run_watcher ones (I will change that on my USB pr)

@fernando79513 fernando79513 self-assigned this Jul 16, 2024
@fernando79513 fernando79513 added the waiting-for-changes The review has been completed but the PR is waiting for changes from the author label Jul 16, 2024
@Hook25 Hook25 removed the waiting-for-changes The review has been completed but the PR is waiting for changes from the author label Jul 18, 2024
Copy link
Collaborator

@fernando79513 fernando79513 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1!

@fernando79513 fernando79513 merged commit b9a7e6f into main Jul 18, 2024
20 of 21 checks passed
@fernando79513 fernando79513 deleted the fix_regex_escaping_2 branch July 18, 2024 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants