canonical / checkbox

Checkbox
https://checkbox.readthedocs.io
GNU General Public License v3.0
30 stars 44 forks source link

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

Open Hook25 opened 1 week ago

Hook25 commented 1 week ago

Description

Avoid all the syntax warning that could soon become errors.

Resolved issues

Documentation

Tests

codecov[bot] commented 1 week ago

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 44.18%. Comparing base (1d1f06a) to head (a570869).

Files Patch % Lines
providers/base/bin/graphics_stress_test.py 0.00% 3 Missing :warning:
providers/base/bin/ipmi_test.py 0.00% 2 Missing :warning:
...kbox-support/checkbox_support/scripts/fwts_test.py 0.00% 1 Missing :warning:
providers/base/bin/battery_test.py 0.00% 1 Missing :warning:
providers/base/bin/frequency_governors_test.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ 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](https://app.codecov.io/gh/canonical/checkbox/pull/1311/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical) | Coverage Δ | | |---|---|---| | [checkbox-support](https://app.codecov.io/gh/canonical/checkbox/pull/1311/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical) | `52.56% <0.00%> (ø)` | | | [provider-base](https://app.codecov.io/gh/canonical/checkbox/pull/1311/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical) | `18.57% <0.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=canonical#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

fernando79513 commented 6 days ago

Some other regex compile that are not using the r: https://github.com/canonical/checkbox/blob/a570869203ed97d42bdf7399b8ba43c69dd7e189/checkbox-support/checkbox_support/scripts/audio_settings.py#L34-L37 https://github.com/canonical/checkbox/blob/a570869203ed97d42bdf7399b8ba43c69dd7e189/providers/base/bin/ipmi_test.py#L248 (just a string) https://github.com/canonical/checkbox/blob/a570869203ed97d42bdf7399b8ba43c69dd7e189/providers/base/bin/network.py#L464 https://github.com/canonical/checkbox/blob/a570869203ed97d42bdf7399b8ba43c69dd7e189/providers/base/bin/pm_log_check.py#L46-L52 https://github.com/canonical/checkbox/blob/a570869203ed97d42bdf7399b8ba43c69dd7e189/providers/resource/bin/block_device_resource.py#L11

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