Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support version tags that don't start with v for semantic versioning #303

Merged
merged 10 commits into from
Jan 2, 2022

Conversation

davidmfinol
Copy link
Member

Changes

Fixes #242

Checklist

  • Read the contribution guide and accept the code of conduct
  • Readme (updated or not needed)
  • Tests (added, updated or not needed)

@github-actions
Copy link

Cat Gif

@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2021

Codecov Report

Merging #303 (b482855) into main (a3e783f) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #303   +/-   ##
=======================================
  Coverage   56.72%   56.72%           
=======================================
  Files          23       23           
  Lines         781      781           
  Branches      158      145   -13     
=======================================
  Hits          443      443           
  Misses        337      337           
  Partials        1        1           
Impacted Files Coverage Δ
src/model/versioning.ts 93.96% <100.00%> (ø)

@GabLeRoux
Copy link
Member

I totally agree with this. According to https://semver.org/ prefixing with v isn't considered semantic so allowing versions without it should definitely be considered 😅

Is “v1.2.3” a semantic version?

No, “v1.2.3” is not a semantic version. However, prefixing a semantic version with a “v” is a common way (in English) to indicate it is a version number. Abbreviating “version” as “v” is often seen with version control. Example: git tag v1.2.3 -m "Release version 1.2.3", in which case “v1.2.3” is a tag name and the semantic version is “1.2.3”.

@webbertakken
Copy link
Member

I totally agree with this. According to https://semver.org/ prefixing with v isn't considered semantic so allowing versions without it should definitely be considered 😅

Is “v1.2.3” a semantic version?
No, “v1.2.3” is not a semantic version. However, prefixing a semantic version with a “v” is a common way (in English) to indicate it is a version number. Abbreviating “version” as “v” is often seen with version control. Example: git tag v1.2.3 -m "Release version 1.2.3", in which case “v1.2.3” is a tag name and the semantic version is “1.2.3”.

While I agree we should support this, the v is not specific to semantic versioning and not part of the semantic version itself. It is GitHub convention to use v in the tag to indicate it's a version tag.

@@ -125,6 +125,7 @@ describe('Versioning', () => {
'is happy with valid %s',
(description) => {
expect(Versioning.descriptionRegex1.test(description)).toBeTruthy();
expect(Versioning.descriptionRegex1.test(description?.slice(1))).toBeTruthy();
Copy link
Member

Choose a reason for hiding this comment

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

Suggest adding a separate tests for it('accepts valid semantic versions without v-prefix', () => {})

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@webbertakken
Copy link
Member

Two more things:

  • Would you mind updating semver-regex as part of this PR?
    image
  • Could you please use descriptive PR titles, so that the releases properly show what changed (without manual work). See description generator: https://takken.io/tools

@davidmfinol davidmfinol changed the title Fixes #242 Support version tags that don't start with v for semantic versioning Dec 13, 2021
@davidmfinol
Copy link
Member Author

davidmfinol commented Dec 13, 2021

  • Would you mind updating semver-regex as part of this PR?

I didn't want to manually update the yarn.lock file, so I found that the semver-regex dependency came from husky, and I updated the versions of husky and lint-staged. The semver-regex dependency is now gone.

  • Could you please use descriptive PR titles, so that the releases properly show what changed (without manual work). See description generator: https://takken.io/tools

I was hoping that the name would come from the linked issue, but I guess it doesn't do that. I've updated the title.

@@ -0,0 +1 @@
_
Copy link
Member

@webbertakken webbertakken Dec 13, 2021

Choose a reason for hiding this comment

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

what does this do exactly? autogenerated?

Copy link
Member Author

@davidmfinol davidmfinol Dec 13, 2021

Choose a reason for hiding this comment

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

Yeah, it's auto-generated. The .husky/_ folder seems to be generated during the pre-commit check as a temporary workspace

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hasAnyVersionTags not counting semver tags that doesn't start with 'v'
4 participants