Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(version): increaseversion_variable flexibility w/ quotes (ie. json, yaml, etc)#1028

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@codejedi365
Copy link
Contributor

@codejedi365codejedi365 commentedSep 23, 2024
edited
Loading

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 wordversion 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

pytest -k test_stamp_version_variables

… (ie. json, yaml, etc)Previously json would not work due to the key being wrapped in quotes, yaml also has issueswhen it does not usually use quotes. The regex we created originally only wrapped the versionto be replaced in quotes but now both the key and version can optionally be wrapped indifferent kind of quotations.Resolves:python-semantic-release#601,python-semantic-release#706,python-semantic-release#962,python-semantic-release#1026
@codejedi365codejedi365force-pushed thefix/version-variable-quote-flexibility branch from7b29ae7 tob339b6dCompareSeptember 27, 2024 06:33
@codejedi365codejedi365 merged commit156915c intopython-semantic-release:masterSep 27, 2024
9 checks passed
@codejedi365codejedi365 deleted the fix/version-variable-quote-flexibility branchSeptember 27, 2024 07:15
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

1 participant

@codejedi365

[8]ページ先頭

©2009-2025 Movatter.jp