| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
… (ie. json, yaml, etc) Previously json would not work due to the key being wrapped in quotes, yaml also has issues when it does not usually use quotes. The regex we created originally only wrapped the version to be replaced in quotes but now both the key and version can optionally be wrapped in different kind of quotations. Resolves: python-semantic-release#601, python-semantic-release#706, python-semantic-release#962, python-semantic-release#1026
| Back | FazBrowse Home | New Git URL |
Purpose
Rationale
Previously json would not work due to the key being wrapped in quotes and therefore the regex would not match
The previous generated regex also has issues with yaml when it does not usually use quotes. The regex originally only wrapped the version to be replaced in quotes (for example: version = "1.2.3") but now both the key and version can optionally be wrapped in different kind of quotations.
I also ended up adding a small negative lookbehind to make sure that our pattern matcher did not match on suffixes of other variable names (ex. cff-version).
How did you test?
I tested json with a single key of the word version which was not supported before unless " were provided. Secondly, I tested yaml where the version did not have quotes around the version. The rest were to validate the capability was maintained for python. I added 4 test cases that replicate the stamping of files of different formats and names. Each test will load the files into memory to ensure they are parsed properly as well that they didn't cause any additional modifications.
How to Verify