jeremiah-c-leary / vhdl-style-guide

Style guide enforcement for VHDL
GNU General Public License v3.0
192 stars 39 forks source link

Deprecation warnings reported during testing. #1223

Closed JHertz5 closed 2 months ago

JHertz5 commented 2 months ago

Environment VSG v3.25.0

Describe the bug The following warnings appear during testing

============================================================= warnings summary ==============================================================
tests/entity/test_rule_008.py:165
  /home/jhertzog/code/vhdl-style-guide-fork/tests/entity/test_rule_008.py:165: DeprecationWarning: invalid escape sequence '\d'
    oRule.regex = "[A-Z][A-Za-z\d]*"

tests/entity/test_rule_008.py:174
  /home/jhertzog/code/vhdl-style-guide-fork/tests/entity/test_rule_008.py:174: DeprecationWarning: invalid escape sequence '\d'
    oRule.regex = "[A-Z][A-Za-z\d]*"

tests/entity/test_rule_008.py:184
  /home/jhertzog/code/vhdl-style-guide-fork/tests/entity/test_rule_008.py:184: DeprecationWarning: invalid escape sequence '\d'
    oRule.regex = "[A-Z][A-Za-z\d]*"

tests/entity/test_rule_008.py:194
  /home/jhertzog/code/vhdl-style-guide-fork/tests/entity/test_rule_008.py:194: DeprecationWarning: invalid escape sequence '\d'
    oRule.regex = "[A-Z][A-Za-z\d]*"

tests/entity/test_rule_008.py:205
  /home/jhertzog/code/vhdl-style-guide-fork/tests/entity/test_rule_008.py:205: DeprecationWarning: invalid escape sequence '\d'
    oRule.regex = "[A-Z][A-Za-z\d]*"

To see an example,

  1. open a CI workflow
  2. open 3.11-build (I haven't checked the other versions)
  3. expand "build"
  4. expand tox test-py311
  5. see the warnings.

The solution to this warning can be found in this stack overflow thread https://stackoverflow.com/questions/50504500/deprecationwarning-invalid-escape-sequence-what-to-use-instead-of-d. Basically the regex patterns in tests/entity/test_rule_008.py need to be declared as raw strings instead of a Unicode strings, so that the /d isn't interpreted as an escape sequence.

JHertz5 commented 2 months ago

I've raised PR #1224 which resolves this issue.

jeremiah-c-leary commented 2 months ago

Evening @JHertz5 ,

Thank you for tracking that down. Time go away from me and it was pretty low on my priority list.

I will get this merged to master.

Regards,

--Jeremy